Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions tools/packaging/packaging.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ function Start-PSPackage {
[ValidateScript({$Environment.IsMacOS})]
[string] $MacOSRuntime,

[switch] $Private,

[Switch] $Force,

[Switch] $SkipReleaseChecks,
Expand Down Expand Up @@ -473,6 +475,7 @@ function Start-PSPackage {
ProductVersion = $Version
Architecture = $WindowsRuntime.Split('-')[1]
Force = $Force
Private = $Private
}

if ($PSCmdlet.ShouldProcess("Create MSIX Package")) {
Expand Down Expand Up @@ -3602,6 +3605,9 @@ function New-MSIXPackage
[ValidateSet('x64','x86','arm','arm64')]
[string] $Architecture,

# Produce private package for testing in Store
[Switch] $Private,

# Force overwrite of package
[Switch] $Force,

Expand Down Expand Up @@ -3630,13 +3636,20 @@ function New-MSIXPackage
$ProductSemanticVersion = Get-PackageSemanticVersion -Version $ProductVersion
$productSemanticVersionWithName = $ProductName + '-' + $ProductSemanticVersion
$packageName = $productSemanticVersionWithName
if ($Private) {
$ProductNameSuffix = 'Private'
}

if ($ProductNameSuffix) {
$packageName += "-$ProductNameSuffix"
}

$displayName = $productName

if ($ProductSemanticVersion.Contains('-')) {
if ($Private) {
$ProductName = 'PowerShell-Private'
$displayName = 'PowerShell-Private'
} elseif ($ProductSemanticVersion.Contains('-')) {
$ProductName += 'Preview'
$displayName += ' Preview'
}
Expand All @@ -3658,7 +3671,15 @@ function New-MSIXPackage

$appxManifest = Get-Content "$RepoRoot\assets\AppxManifest.xml" -Raw
$appxManifest = $appxManifest.Replace('$VERSION$', $ProductVersion).Replace('$ARCH$', $Architecture).Replace('$PRODUCTNAME$', $productName).Replace('$DISPLAYNAME$', $displayName).Replace('$PUBLISHER$', $releasePublisher)
Set-Content -Path "$ProductSourcePath\AppxManifest.xml" -Value $appxManifest -Force
$xml = [xml]$appxManifest
if ($isPreview) {
Write-Verbose -Verbose "Adding pwsh-preview.exe alias"
$aliasNode = $xml.Package.Applications.Application.Extensions.Extension.AppExecutionAlias.ExecutionAlias.Clone()
$aliasNode.alias = "pwsh-preview.exe"
$xml.Package.Applications.Application.Extensions.Extension.AppExecutionAlias.AppendChild($aliasNode) | Out-Null
}
$xml.Save("$ProductSourcePath\AppxManifest.xml")

# Necessary image assets need to be in source assets folder
$assets = @(
'Square150x150Logo'
Expand Down