ofribouba
ofribouba

Reputation: 27

Powershell doesnt recognize script

Ive created a script for users in my company to use with powershell ise and when I run it there using F5 it is working.

Ive set the executionpolicy to unrestricted as well.

Later Ive tried to open this script with powershell.exe because I need it to run straight for the users, and it gave the error:

The term "C:\users\ofir\Script\Json is not recognized as a cmdlet, function, script file, or operable program..

What could be the problem? Thanks, Ofir.

Upvotes: 0

Views: 473

Answers (1)

restless1987
restless1987

Reputation: 1598

As I suspect you to run the file like powershell.exe -file C:\Users\What\Not\Json File.ps1 I could think of missing quotationmarks.

Try

  Powershell.exe -file "Path\To\File"

Upvotes: 1

Related Questions