Skip to content

Commit 24efb73

Browse files
authored
Rename manifest identifier and output folder (#88)
* Rename manifest identifier and output folder * PR feedback
1 parent d80e01d commit 24efb73

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

Tools/PowershellModule/src/Library/Add-WinGetManifest.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Function Add-WinGetManifest
124124
{
125125
foreach ($Manifest in $ApplicationManifest) {
126126
Write-Verbose -Message "Confirming that the Package ID doesn't already exist in Azure for $($Manifest.PackageIdentifier)."
127-
$GetResult = Get-WinGetManifest -FunctionName $AzureFunctionName -SubscriptionName $SubscriptionName -ManifestIdentifier $Manifest.PackageIdentifier
127+
$GetResult = Get-WinGetManifest -FunctionName $AzureFunctionName -SubscriptionName $SubscriptionName -PackageIdentifier $Manifest.PackageIdentifier
128128

129129
$ManifestObject = $Manifest
130130
$TriggerName = "ManifestPost"

Tools/PowershellModule/src/Library/Get-WinGetManifest.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Function Get-WinGetManifest
3333
.PARAMETER FunctionName
3434
Name of the Azure Function Name that contains the Windows Package Manager REST APIs.
3535
36-
.PARAMETER ManifestIdentifier
36+
.PARAMETER PackageIdentifier
3737
[Optional] The Windows Package Manager Package Identifier of a specific Package Manifest result.
3838
3939
.PARAMETER SubscriptionName
@@ -50,12 +50,12 @@ Function Get-WinGetManifest
5050
Returns a Manifest object (*.json) of the specified JSON file.
5151
5252
.EXAMPLE
53-
Get-WinGetManifest -FunctionName "contosorestsource" -ManifestIdentifier "Windows.PowerToys"
53+
Get-WinGetManifest -FunctionName "contosorestsource" -PackageIdentifier "Windows.PowerToys"
5454
5555
Returns a Manifest object of the specified Package Identifier that is queried against in the REST APIs.
5656
5757
.EXAMPLE
58-
Get-WinGetManifest -FunctionName "contosorestsource" -ManifestIdentifier "Windows.PowerToys" -SubscriptionName "Visual Studio Subscription"
58+
Get-WinGetManifest -FunctionName "contosorestsource" -PackageIdentifier "Windows.PowerToys" -SubscriptionName "Visual Studio Subscription"
5959
6060
Returns a Manifest object of the specified Package Identifier that is queried against in the REST APIs from the specified Subscription Name.
6161
@@ -70,7 +70,7 @@ Function Get-WinGetManifest
7070
[Parameter(Position=0, Mandatory=$true, ParameterSetName="File")] [string]$Path,
7171
[Parameter(Position=1, Mandatory=$false,ParameterSetName="File")] [WinGetManifest]$JSON,
7272
[Parameter(Position=0, Mandatory=$true, ParameterSetName="Azure")] [string]$FunctionName,
73-
[Parameter(Position=1, Mandatory=$false,ParameterSetName="Azure")] [string]$ManifestIdentifier,
73+
[Parameter(Position=1, Mandatory=$false,ParameterSetName="Azure")] [string]$PackageIdentifier,
7474
[Parameter(Position=2, Mandatory=$false,ParameterSetName="Azure")] [string]$SubscriptionName
7575
)
7676
BEGIN
@@ -118,8 +118,8 @@ Function Get-WinGetManifest
118118
throw "Failed to confirm resources exist in Azure. Please verify and try again."
119119
}
120120

121-
if($ManifestIdentifier){
122-
$ManifestIdentifier = "/$ManifestIdentifier"
121+
if($PackageIdentifier){
122+
$PackageIdentifier = "/$PackageIdentifier"
123123
}
124124

125125
###############################
@@ -244,7 +244,7 @@ Function Get-WinGetManifest
244244
$DefaultHostName = $FunctionApp.DefaultHostName
245245
$FunctionKey = (Invoke-AzResourceAction -ResourceId "$FunctionAppId/functions/$TriggerName" -Action listkeys -Force).default
246246
$apiHeader.Add("x-functions-key", $FunctionKey)
247-
$AzFunctionURL = "https://" + $DefaultHostName + "/api/" + "packageManifests" + $ManifestIdentifier
247+
$AzFunctionURL = "https://" + $DefaultHostName + "/api/" + "packageManifests" + $PackageIdentifier
248248

249249
## Publishes the Manifest to the Windows Package Manager REST source
250250
Write-Verbose -Message "Invoking the REST API call."

Tools/PowershellModule/src/Library/Remove-WinGetManifest.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ Function Remove-WinGetManifest
1919
.PARAMETER FunctionName
2020
Name of the Azure Function that hosts the REST source.
2121
22-
.PARAMETER ManifestIdentifier
22+
.PARAMETER PackageIdentifier
2323
THe Package Id that represents the App Manifest to be removed.
2424
2525
.PARAMETER SubscriptionName
2626
[Optional] The Subscription name contains the Windows Package Manager REST source
2727
2828
.EXAMPLE
29-
Remove-WinGetManifest -FunctionName "contosorestsource" -ManifestIdentifier "Windows.PowerToys"
29+
Remove-WinGetManifest -FunctionName "contosorestsource" -PackageIdentifier "Windows.PowerToys"
3030
3131
Connects to Azure, then runs the Azure Function "contosorestsource" REST APIs to remove the specified Manifest file from
3232
the Windows Package Manager REST source
@@ -35,7 +35,7 @@ Function Remove-WinGetManifest
3535
[CmdletBinding(DefaultParameterSetName = 'WinGet')]
3636
PARAM(
3737
[Parameter(Position=0, Mandatory=$true, ParameterSetName="Azure")] [string]$FunctionName,
38-
[Parameter(Position=2, Mandatory=$true)] [string]$ManifestIdentifier,
38+
[Parameter(Position=2, Mandatory=$true)] [string]$PackageIdentifier,
3939
[Parameter(Position=3, Mandatory=$false)] [string]$SubscriptionName = ""
4040
)
4141
BEGIN
@@ -72,8 +72,8 @@ Function Remove-WinGetManifest
7272
throw "Failed to confirm resources exist in Azure. Please verify and try again."
7373
}
7474

75-
if($ManifestIdentifier){
76-
$ManifestIdentifier = "$ManifestIdentifier"
75+
if($PackageIdentifier){
76+
$PackageIdentifier = "$PackageIdentifier"
7777
}
7878

7979
###############################
@@ -96,7 +96,7 @@ Function Remove-WinGetManifest
9696
$apiHeader.Add("Accept", 'application/json')
9797
$apiHeader.Add("x-functions-key", $FunctionKey)
9898

99-
$AzFunctionURL = "https://" + $DefaultHostName + "/api/" + "packageManifests/" + $ManifestIdentifier
99+
$AzFunctionURL = "https://" + $DefaultHostName + "/api/" + "packageManifests/" + $PackageIdentifier
100100
}
101101
}
102102
}

pipelines/templates/copy-and-publish-powershell.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Template helper to copy powershell scripts and all dependencies
1+
# Template helper to copy PowerShell scripts and all dependencies
22
parameters:
33
helperLibsPath: '$(Build.SourcesDirectory)\src\WinGet.RestSource.PowershellSupport\bin\$(BuildConfiguration)\netstandard2.0'
44
templatesPath: '$(build.SourcesDirectory)\src\WinGet.RestSource.Infrastructure\bin\$(BuildConfiguration)'
@@ -8,7 +8,7 @@ steps:
88
displayName: 'Copy Files: Powershell module'
99
inputs:
1010
SourceFolder: '$(build.SourcesDirectory)\Tools\PowershellModule\src'
11-
TargetFolder: '$(build.artifactstagingdirectory)\Winget.Powershell.Source'
11+
TargetFolder: '$(build.artifactstagingdirectory)\Winget.PowerShell.Source'
1212
CleanTargetFolder: true
1313
OverWrite: true
1414

@@ -24,7 +24,7 @@ steps:
2424
${{ parameters.helperLibsPath }}\YamlDotNet.dll
2525
${{ parameters.helperLibsPath }}\WinGetUtilInterop.dll
2626
${{ parameters.helperLibsPath }}\runtimes\win-x86\native\WinGetUtil.dll
27-
TargetFolder: '$(build.artifactstagingdirectory)\Winget.Powershell.Source\Library\HelperLib\x86'
27+
TargetFolder: '$(build.artifactstagingdirectory)\Winget.PowerShell.Source\Library\HelperLib\x86'
2828
OverWrite: true
2929
flattenFolders: true
3030

@@ -40,7 +40,7 @@ steps:
4040
${{ parameters.helperLibsPath }}\YamlDotNet.dll
4141
${{ parameters.helperLibsPath }}\WinGetUtilInterop.dll
4242
${{ parameters.helperLibsPath }}\runtimes\win-x64\native\WinGetUtil.dll
43-
TargetFolder: '$(build.artifactstagingdirectory)\Winget.Powershell.Source\Library\HelperLib\x64'
43+
TargetFolder: '$(build.artifactstagingdirectory)\Winget.PowerShell.Source\Library\HelperLib\x64'
4444
OverWrite: true
4545
flattenFolders: true
4646

@@ -58,19 +58,19 @@ steps:
5858
${{ parameters.templatesPath }}\**\frontdoor.json
5959
${{ parameters.templatesPath }}\**\keyvault.json
6060
${{ parameters.templatesPath }}\**\storageaccount.json
61-
TargetFolder: '$(build.artifactstagingdirectory)\Winget.Powershell.Source\Library\ARMTemplate'
61+
TargetFolder: '$(build.artifactstagingdirectory)\Winget.PowerShell.Source\Library\ARMTemplate'
6262
OverWrite: true
6363
flattenFolders: true
6464

6565
- task: CopyFiles@2
6666
displayName: 'Copy Files: azure function'
6767
inputs:
6868
SourceFolder: '$(Build.ArtifactStagingDirectory)\WinGet.RestSource.Functions'
69-
TargetFolder: '$(build.artifactstagingdirectory)\Winget.Powershell.Source\Library\RestAPI'
69+
TargetFolder: '$(build.artifactstagingdirectory)\Winget.PowerShell.Source\Library\RestAPI'
7070
OverWrite: true
7171

7272
- task: PublishBuildArtifacts@1
73-
displayName: 'Publish Artifact: WinGet.RestSource-Winget.Powershell.Source'
73+
displayName: 'Publish Artifact: WinGet.RestSource-Winget.PowerShell.Source'
7474
inputs:
75-
PathtoPublish: '$(build.artifactstagingdirectory)\Winget.Powershell.Source'
76-
ArtifactName: 'WinGet.RestSource-Winget.Powershell.Source'
75+
PathtoPublish: '$(build.artifactstagingdirectory)\Winget.PowerShell.Source'
76+
ArtifactName: 'WinGet.RestSource-Winget.PowerShell.Source'

0 commit comments

Comments
 (0)