I developed a script in Powershell_ISE to backup a SQL Server database on one server, move the file to another server, and restore to the target server with a different database name. It works great.
It uses 6 required parameters. In Powershell_ISE, I can run
C:\PowershellScripts\Servers\CRMBackup.ps1 -SrcSrv uk-sb-sql12\wss -SrcDb UAT_2016_MSCRM
-SrcBak \\uk-sb-sql12\backup\ -TrgSrv uk-sb-sql12\wss -TrgDb preprod_mscrm66 -TrgBak
\\uk-sb-sql12\backup\
and it works great.
I can not get it to work from the command line. How to achieve this?
If I run
powershell_ise.exe "C:\PowershellScripts\Servers\CRMBackup.ps1" -SrcSrv uk-sb-sql12\wss
-SrcDb UAT_2016_MSCRM -SrcBak \\uk-sb-sql12\backup\ -TrgSrv uk-sb-sql12\wss -TrgDb
preprod_mscrm66 -TrgBak \\uk-sb-sql12\backup\
from the command line I get the error message:

If I call Powershell instead of Powershell_ISE, everything is fine:
powershell.exe "C:\PowershellScripts\Servers\CRMBackup.ps1" -SrcSrv uk-sb-sql12\wss
-SrcDb UAT_2016_MSCRM -SrcBak \\uk-sb-sql12\backup\ -TrgSrv uk-sb-sql12\wss -TrgDb
preprod_mscrm66 -TrgBak \\uk-sb-sql12\backup\
succeeds:

Can someone tell me how to pass command line options to Powershell_ISE?
thank