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 Password last set
by  gbhsmis   Go to last post Go to first unread
Last post: 11/5/2021 8:59:46 PM(UTC)
Action List IP Configuration Data
by  Don  
Go to last post Go to first unread
Last post: 11/4/2021 4:35:06 PM(UTC)
Action View users membersof
by  Don   Go to last post Go to first unread
Last post: 11/4/2021 3:46:45 PM(UTC)
Action Remote Uninstaller
by  Gahbiche  
Go to last post Go to first unread
Last post: 11/4/2021 3:35:07 PM(UTC)
Lansweeper Updating Active Directory User fields
by  Don   Go to last post Go to first unread
Last post: 11/2/2021 8:21:46 PM(UTC)
Action Powershell Remote Shutdown with Different Creds
by  Wealthyreltub  
Go to last post Go to first unread
Last post: 9/14/2021 9:43:09 PM(UTC)
Action Find lost space the easy way (spacesniffer.exe)
by  tomscott2340   Go to last post Go to first unread
Last post: 9/1/2021 8:22:48 PM(UTC)
Lansweeper uVNC Portable (trying to replace LSRemote)
by  CyberCitizen  
Go to last post Go to first unread
Last post: 6/15/2021 11:40:21 PM(UTC)