Calling a Powershell script with multiple parameters

If you are working with a PowerShell​ script that takes parameters and some of those parameters contain spaces you can call the script as follows.

powershell “& {&’C:\Users\<user folder>\Documents\BackupFiles.ps1′ ‘\\server\share\a folder with spaces’ ‘\\server\share\another folder with a space’}”

The first value passed after the -command is the ps1 script and then the parameters the script takes are passed, but they are enclosed in single quotes.

The initial “&{& and the closing } are the important points to note.