@@ -18,6 +18,7 @@ function Publish-Script {
1818 [Parameter (Mandatory = $true ,
1919 ValueFromPipelineByPropertyName = $true ,
2020 ParameterSetName = ' LiteralPathParameterSet' )]
21+ [Alias (' PSPath' )]
2122 [ValidateNotNullOrEmpty ()]
2223 [string ]
2324 $LiteralPath ,
@@ -49,7 +50,7 @@ function Publish-Script {
4950 $scriptFilePath = $null
5051 if ($Path ) {
5152 $scriptFilePath = Resolve-PathHelper - Path $Path - CallerPSCmdlet $PSCmdlet |
52- Microsoft.PowerShell.Utility\Select-Object - First 1 - ErrorAction Ignore
53+ Microsoft.PowerShell.Utility\Select-Object - First 1 - ErrorAction Ignore
5354
5455 if (-not $scriptFilePath -or
5556 -not (Microsoft.PowerShell.Management\Test-Path - Path $scriptFilePath - PathType Leaf)) {
@@ -64,7 +65,7 @@ function Publish-Script {
6465 }
6566 else {
6667 $scriptFilePath = Resolve-PathHelper - Path $LiteralPath - IsLiteralPath - CallerPSCmdlet $PSCmdlet |
67- Microsoft.PowerShell.Utility\Select-Object - First 1 - ErrorAction Ignore
68+ Microsoft.PowerShell.Utility\Select-Object - First 1 - ErrorAction Ignore
6869
6970 if (-not $scriptFilePath -or
7071 -not (Microsoft.PowerShell.Management\Test-Path - LiteralPath $scriptFilePath - PathType Leaf)) {
@@ -117,8 +118,7 @@ function Publish-Script {
117118
118119 if (-not $DestinationLocation -or
119120 (-not (Microsoft.PowerShell.Management\Test-Path - Path $DestinationLocation ) -and
120- -not (Test-WebUri - uri $DestinationLocation )))
121- {
121+ -not (Test-WebUri - uri $DestinationLocation ))) {
122122 $message = $LocalizedData.PSRepositoryScriptPublishLocationIsMissing -f ($Repository , $Repository )
123123 ThrowError - ExceptionName " System.ArgumentException" `
124124 - ExceptionMessage $message `
@@ -182,7 +182,7 @@ function Publish-Script {
182182
183183 # Copy the source script file to temp location to publish
184184 $tempScriptPath = Microsoft.PowerShell.Management\Join-Path - Path $script :TempPath - ChildPath " $ ( Get-Random ) " |
185- Microsoft.PowerShell.Management\Join-Path - ChildPath $scriptName
185+ Microsoft.PowerShell.Management\Join-Path - ChildPath $scriptName
186186
187187 $null = Microsoft.PowerShell.Management\New-Item - Path $tempScriptPath - ItemType Directory - Force - ErrorAction SilentlyContinue - WarningAction SilentlyContinue - Confirm:$false - WhatIf:$false
188188 if ($Path ) {
@@ -211,8 +211,8 @@ function Publish-Script {
211211 # Check if the specified script name is already used for a module on the specified repository
212212 # Use Find-Module to check if that name is already used as module name
213213 $modulePSGetItemInfo = Find-Module @FindParameters |
214- Microsoft.PowerShell.Core\Where-Object {$_.Name -eq $scriptName } |
215- Microsoft.PowerShell.Utility\Select-Object - Last 1 - ErrorAction Ignore
214+ Microsoft.PowerShell.Core\Where-Object { $_.Name -eq $scriptName } |
215+ Microsoft.PowerShell.Utility\Select-Object - Last 1 - ErrorAction Ignore
216216 if ($modulePSGetItemInfo ) {
217217 $message = $LocalizedData.SpecifiedNameIsAlearyUsed -f ($scriptName , $Repository , ' Find-Module' )
218218 ThrowError - ExceptionName " System.InvalidOperationException" `
@@ -227,8 +227,8 @@ function Publish-Script {
227227
228228 $currentPSGetItemInfo = $null
229229 $currentPSGetItemInfo = Find-Script @FindParameters |
230- Microsoft.PowerShell.Core\Where-Object {$_.Name -eq $scriptName } |
231- Microsoft.PowerShell.Utility\Select-Object - Last 1 - ErrorAction Ignore
230+ Microsoft.PowerShell.Core\Where-Object { $_.Name -eq $scriptName } |
231+ Microsoft.PowerShell.Utility\Select-Object - Last 1 - ErrorAction Ignore
232232
233233 if ($currentPSGetItemInfo ) {
234234 $result = ValidateAndGet- VersionPrereleaseStrings - Version $currentPSGetItemInfo.Version - CallerPSCmdlet $PSCmdlet
0 commit comments