→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cstoop
Engaged Sweeper
I would like to run a powershell script (.ps1) file which resists on a network share on several clients.
I have tried with the invoke-command etc. but is not a success.

The question is how to run a powershell ps1 file with Lansweeper.
I have already tried the following:
script
powershell.exe -executionpolicy bypass -file \\fsnl\gpodiverse\Teams\Install-MicrosoftTeams.ps1

or

installer

{PackageShare}\powershell.exe -executionpolicy bypass -file \\fileshare\Teams\Install-MicrosoftTeams.ps1

The goal is to install a softwarepackager on some clients which is a msi file and i would like to do this with powershell thru Lansweeper.
3 REPLIES 3
CyberCitizen
Honored Sweeper
This works perfectly fine for me.

Installer Type Cpmmand
powershell.exe -executionpolicy bypass -file "{PackageShare}\CleanUpMGRScript.ps1"
CyberCitizen wrote:
This works perfectly fine for me.

Installer Type Cpmmand
powershell.exe -executionpolicy bypass -file "{PackageShare}\CleanUpMGRScript.ps1"


I have made a exe from the ps1 and try to execute that with Lansweeper.
I get an error on the client that there is something with the CAB file and that it cannot extract it problebly not enough memory or something but tis is new pc with enough memory?

The message is from LSdeployment\remotedeployment_x64.exe


brandon_jones
Champion Sweeper III
You would need to save the PowerShell script on your Lansweeper server in the package share folder. In the deployment you should be able to use the following command: powershell.exe -executionpolicy bypass -file "{PackageShare}\Install-MicrosoftTeams.ps1"