Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.11.1 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

install package using powershell script


I need to serach and find the version of one of the application in serveral PCs, and then uninstall it and install the last version by using the package in OCS.

I bulid my package but I need to know how to run the powershell script from the command filed in execute mode

I used this one but it is notwork :

powershell.exe -executionpolicy bypass -noprofile -command "&{ .\my_script.ps1}"

anyone have an idea to solve this
note I test the script and it is work fine, but OCS can't run it
best regards,
in OCS Inventory NG agent for Windows by (160 points)

3 Answers

0 votes

Consult the documentation on how to deploy a package => http://wiki.ocsinventory-ng.org/05.Deployment/Deploying-packages-or-executing-commands-on-client-hosts/

Best regards

by (88.5k points)
0 votes

I already did but there is noting about run powershell script in it

by (160 points)
0 votes


Try like this

"powershell.exe -executionpolicy bypass -noprofile -command "&{ .\my_script.ps1}""

Check if Powershell is authorized on station ?

if still don't work,  Give us agent log file  in c:\programdata\ocs inventory ng\agent directory. Verify the option "debug=1 or debug=2" is set in ocsinventory.ini file (located at the same place)*

*Inspired Franck original post here smiley


by (5.7k points)
Powered by Question2Answer