NAME
Save-Script
SYNOPSIS
Saves a script.SYNTAX
Save-Script [-InputObject]
[-Confirm] [-Credential ] [-Force] -LiteralPath [-Proxy
] [-ProxyCredential ] [-WhatIf] [ ] Save-Script [-InputObject]
[-Confirm] [-Credential ] [-Force] -Path [-Proxy
] [-ProxyCredential ] [-WhatIf] [ ] Save-Script [-Name]
[-Confirm] [-Credential ] [-Force] -LiteralPath [-MaximumVersion
] [-MinimumVersion ] [-Proxy ] [-ProxyCredential ] [-Repository
] [-RequiredVersion ] [-WhatIf] [ ] Save-Script [-Name]
[-Confirm] [-Credential ] [-Force] [-MaximumVersion ] [-MinimumVersion
] -Path [-Proxy ] [-ProxyCredential ] [-Repository
] [-RequiredVersion ] [-WhatIf] [ ] DESCRIPTION
The Save-Script cmdlet saves the specified script.
PARAMETERS
-Confirm [
Prompts you for confirmation before running the cmdlet. Required? false Position? named Default value False Accept pipeline input? False Accept wildcard characters? false] -Credential
@{Text=} Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-Force [
Forces the command to run without asking for user confirmation. Required? false Position? named Default value False Accept pipeline input? False Accept wildcard characters? false] -InputObject
{{Fill InputObject Description}} Required? true Position? 0 Default value NoneAccept pipeline input? True (ByPropertyName, ByValue)
Accept wildcard characters? false-LiteralPath
Specifies a path to one or more locations. Unlike the Path parameter, the value of the LiteralPath parameter is used exactly as entered. No characters are interpreted as wildcards. If the path includes escape characters, enclose them in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. Required? true Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-MaximumVersion
Specifies the maximum, or newest version of the script to save. The MaximumVersion and RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command. Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-MinimumVersion
Specifies the minimum version of the script to find. The MinimumVersion and the RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command. Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-Name
Specifies an array of names of scripts to save. Required? true Position? 0 Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-Path
Specifies a path to one or more locations. Wildcards are permitted. The default location is the current directory (.). Required? true Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-Proxy
@{Text=} Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-ProxyCredential
@{Text=} Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-Repository
Specifies the friendly name of a repository that has been registered by running Register-PSRepository.
Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-RequiredVersion
Specifies the exact version number of the script to save. Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-WhatIf [
Shows what would happen if the cmdlet runs. The cmdlet is not run. Required? false Position? named Default value False Accept pipeline input? False Accept wildcard characters? false] This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). INPUTS
OUTPUTS
NOTES
Example 1: Save a script and validate it
PS C:\>Save-Script -Name "Fabrikam-ClientScript" -Repository "Local01" -Path "D:\ScriptSharingDemo"
PS C:\> Test-ScriptFileInfo -Path "D:\ScriptSharingDemo\Fabrikam-ClientScript.ps1"
Version Name Author Description
------- ---- ------ -----------
2.5 Fabrikam-ClientScript pattif Description for the Fabrikam-ClientScript script
The first command saves the script Fabrikam-ClientScript from the Local01 repository to the local folder
D:\ScriptSharingDemo.The second command uses the Test-ScriptFileInfo cmdlet to validate the script.
RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/?LinkId=822334Find-Script
Install-Script
Publish-Script
Uninstall-Script
Update-Script