- 1 year ago
powershell script throwing cmd not found error for powershell tag
Comment
1 / 1
It's unclear what the issue is without more details, but one possible explanation is that the PowerShell script is being executed as a batch file, not as a PowerShell script. In this case, it could be that the script is using PowerShell syntax (e.g., using the PowerShell
tag) which is not recognized by the command prompt.
To ensure that a PowerShell script is executed as a PowerShell script, the script file extension should be .ps1
. Additionally, the script can be executed from within a PowerShell prompt by typing .\scriptname.ps1
.