Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit e23f707

Browse files
committed
Add default behavior for PowerShell rid param
1 parent 6e2f8f6 commit e23f707

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

deploy/deploy.ps1

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[CmdletBinding()]
44
param (
5-
[Parameter(Mandatory = $true)]
5+
[Parameter(Mandatory = $false)]
66
[ValidateSet("win-x64", "linux-x64", "osx-x64")]
77
[string]$RuntimeIdentifier,
88

@@ -38,6 +38,20 @@ begin {
3838
}
3939

4040
process {
41+
if (!$RuntimeIdentifier) {
42+
if ($IsLinux) {
43+
$RuntimeIdentifier = "linux-x64"
44+
}
45+
elseif ($IsMacOS) {
46+
$RuntimeIdentifier = "osx-x64"
47+
}
48+
else {
49+
$RuntimeIdentifier = "win-x64"
50+
}
51+
52+
Write-Host "The -RuntimeIdentifier parameter has been given a default value of '$RuntimeIdentifier'."
53+
}
54+
4155
Import-Module (Join-Path $PSScriptRoot "scripts/NuGet.Insights.psm1")
4256

4357
$resourceSettings = Get-ResourceSettings $ConfigName $StampName

0 commit comments

Comments
 (0)