cmd - How to run a powershell script with white spaces in path from command line? -


so i've tried bunch of different ways run powershell script command line , every single 1 returns error.

here path:

c:\users\test\documents\test\line space\ps script\test.ps1 

i've tried these:

powershell -file '"c:\users\test\documents\test\line space\ps script\test.ps1"'  powershell "& ""c:\users\test\documents\test\line space\ps script\test.ps1"""  powershell "& 'c:\users\test\documents\test\line space\ps script\test.ps1'"  powershell -file 'c:\users\test\documents\test\line space\ps script\test.ps1'" 

i these errors:

& : term 'c:\users\test\documents\test\line space\ps script\' not recognized name of cmdlet, function, script file, or operable program. check spelling of name, or if path included, verify path correct , try again.

processing -file ''c:\users\test\documents\test\line space\ps script\'' failed: given path's format not support ed. specify valid path -file parameter.

any appreciated!

in examples, you're mixing quotes , double quoting no reason.

if exist "c:\users\test\documents\test\line space\ps script\test.ps1" (   powershell -executionpolicy unrestricted -file "c:\users\test\documents\test\line space\ps script\test.ps1" ) 

Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -