search cancel

Unable to run PowerShell script to push a Windows Feature update to certain windows machines

book

Article ID: 238628

calendar_today

Updated On:

Products

Client Management Suite IT Management Suite

Issue/Introduction

When importing a PowerShell script as a software package, the import process does not populate a command line into the software resource command line.

Tested with "PowerShell FILENAME.PS1", but it failed.

 

Cause

Incorrect syntax. Software Deliveries with open a Command session (cmd.exe) open to the cache folder on the client where the package resides. When pasting in the command line in a manual test, we saw that the error indicated it did not recognize the "filename" as a cmdlet, function, script file, or operable program - indicating PowerShell did not recognize that you were passing a file to run.

Environment

Release: 8.x

Resolution

The syntax to run a PowerShell script from a Command session is to place a dot-backslash before the file name

PowerShell .\FILENAME.PS1