I have a Powershell script that takes two arguments.
param([string]$folder, [string]$filename)
When I open a Powershell shell, navigate to the folder that contains the script, and run it from there, the script is executed correctly:
C:\scriptfolder> ".\script.ps1" "C:\folder for argument" "filename.ext"
When I try to run the script from a different folder, I get an error message:
C:\otherfolder> "C:\scriptfolder\script.ps1" "C:\folder for argument" "filename.ext"
At line:1 char:nn
Unexpected token '"C:\folder for argument"' in expression or statement.
How can I run this script from another folder?