Notification

Icon
Error

PowerShell from Deployment Package

Posted: Monday, March 9, 2015 5:01:57 PM(UTC)
ferdydek

ferdydek

Member Original PosterPosts: 1
3
Like
This issue has been solved! Click here to view the solution
How to run PowerShell script via Deployment Packages?
Daniel.B
#1Daniel.B Member Posts: 1,150  
posted: 3/10/2015 12:08:53 PM(UTC)
In a command step you can use the command
Code:

powershell "[powershell command]"


Open a cmd on your computer and type
Code:

powershell -help

in order to see details about which parameters are available.
keys_it
#2keys_it Member Posts: 31  
posted: 9/2/2015 3:56:23 PM(UTC)
We have issues with just running this way due to the execution policy (for security reasons we do not change the default).

A better way to avoid having this issue is to run PowerShell commands and scripts this way in a command step:

PowerShell Commands
Code:
powershell.exe -executionpolicy bypass -command {"commands go here"}


PowerShell Scripts
Code:
powershell.exe -executionpolicy bypass -file "{PackageShare}\Scripts\script.ps1"


This will guarantee that PowerShell commands and scripts run as intended.

Active Discussions

Lansweeper Linux Agent - login user
by  Dinusha Chandrasinghe   Go to last post Go to first unread
Last post: Today at 11:03:07 AM(UTC)
Lansweeper device with multiple NICs
by  mzipperer  
Go to last post Go to first unread
Last post: Yesterday at 7:42:57 PM(UTC)
Lansweeper Internal Note
by  mdavis2503   Go to last post Go to first unread
Last post: Yesterday at 6:00:07 PM(UTC)
Lansweeper Problem with deploy software
by  Max90  
Go to last post Go to first unread
Last post: Yesterday at 12:09:40 PM(UTC)
Lansweeper Can lsagent be protected from deletion
by  RKCar   Go to last post Go to first unread
Last post: 11/29/2021 8:56:09 PM(UTC)
Lansweeper HTTPS not secure
by  Larry Rhea  
Go to last post Go to first unread
Last post: 11/29/2021 7:50:59 PM(UTC)
Lansweeper Warning about Built-in Admin
by  Larry Rhea   Go to last post Go to first unread
Last post: 11/29/2021 7:45:45 PM(UTC)