Set-PSUScript
SYNOPSIS
Sets properties of a script.
SYNTAX
Id
Set-PSUScript [-Id] <Int64> [-Name <String>] [-Description <String>] [-ManualTime <Double>] [-TimeOut <Double>]
[-Status <String>] [-Content <String>] [-Notes <String>] [-Environment <String>]
[-DisableManualInvocation <Boolean>] [-ScriptErrorAction <ActionPreference>] [-MaxHistory <Int32>]
[-Tag <Tag[]>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>]
[-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
[<CommonParameters>]Script
Set-PSUScript [-Script] <Script> [-Name <String>] [-Description <String>] [-ManualTime <Double>]
[-TimeOut <Double>] [-Status <String>] [-Content <String>] [-Notes <String>] [-Environment <String>]
[-DisableManualInvocation <Boolean>] [-ScriptErrorAction <ActionPreference>] [-MaxHistory <Int32>]
[-Tag <Tag[]>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>]
[-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
[<CommonParameters>]ScriptBlock
DESCRIPTION
Sets properties of a script. Properties will be stored in both the database and the git repo.
EXAMPLES
Example 1
Sets the description and manual time of Script1.ps1.
PARAMETERS
-AppToken
An app token to access the PSU API.
-ComputerName
The HTTP address of the PSU REST API server.
-Content
The content of the script.
-Description
The description of the script.
-DisableManualInvocation
Prevents this script from running manual. It can only run by schedule.
-Environment
Specifies the execution environment to use.
-Id
The ID of the script to set.
-Integrated
Executes the command internally rather than using the Management API. Only works when running script from within PowerShell Universal.
-ManualTime
The manual execution time of this script.
-MaxHistory
Specifies the maximum number of historical entries to retain.
-Name
The name of this script.
-Notes
Notes to include with this script.
-Script
The script to set properties on. Use Get-UAScript to retrieve a Script object.
-ScriptBlock
The script block used to set the content of the script.
-ScriptErrorAction
Specifies how PowerShell Universal handles script errors during execution.
-Status
The status of the script. This is not currently used.
-Tag
Sets the tags for a script.
-TimeOut
Specifies the maximum time, in seconds, that the script can run.
-UseDefaultCredentials
Use default credentials when connecting to the management API
-Credential
Credentials to login to the PowerShell Universal Management API.
-TrustCertificate
Whether the cmdlet should ignore certificate issues.
-Cookies
Reuses and persists authentication cookies for the current PowerShell session.
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction. For more information, see about_CommonParameters.
INPUTS
UniversalAutomation.Script
OUTPUTS
System.Object
NOTES
RELATED LINKS
PERMISSIONS
The access token requires automation.scripts.<script path>/update to run this cmdlet remotely. Renaming or moving a script requires update access to both its original and destination paths.
Last updated
Was this helpful?