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.5 available

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

install package using powershell script

Hello,

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,
asked in OCS Inventory NG agent for Windows by (160 points)

3 Answers

0 votes
Hi

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

Frank
answered by (69.9k points)
0 votes
@frankb

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

thanks
answered by (160 points)
0 votes

Hi,

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

Regards

answered ago by (2.4k points)
 
Powered by Question2Answer
...