Invoke-PowerShellCode
PackageDeployment Module Help |
Package Deployment Module |
Invoke-PowerShellCode Cmdlet |
Version 4.0.0.5 |
Invoke-PowerShellCode
Synopsis
Executes PowerShell code and logs the execution in the log file.
Syntax
Invoke-PowerShellCode [-Script] <scriptblock> [[-LogAs] <string>] [[-ReverseScript] <scriptblock>] [[-LogReverseAs] <string>] [[-ResultVariable] <string>] [[-Context] {Any | User | UserPerService | Computer | ComputerPerService}] [<CommonParameters>]
Description
Executes PowerShell code and logs the execution in the log file.
Parameters
-Script <scriptblock> |
||||||
PowerShell code to execute |
||||||
|
-LogsAs <string> |
||||||
Name under which the code block is logged in the log file. |
||||||
|
-ReverseScript <scriptblock> |
||||||
PowerShell code that is executed when the command is uninstalled. |
||||||
|
-LogReverseAs <string> |
||||||
Name under which the code block of the uninstallation is logged in the log file. |
||||||
|
-ResultVariable <string> |
||||||
Name of the variable where the result of the code execution will be stored. |
||||||
|
-Context <String> |
||||||
User: Execution under user account; logging in HKEY_CURRENT_USER, i.e. for the user. |
||||||
|
<CommonParameters> |
For more information about common parameters, type "Get-Help about_CommonParameters". |