File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,28 @@ function Install-AzAksCliTool
120
120
}
121
121
}
122
122
123
+ function IsWindows {
124
+ [Microsoft.Azure.PowerShell.Cmdlets.Aks.DoNotExportAttribute ()]
125
+ param (
126
+ )
127
+ process {
128
+ return (Get-OSName ).contains(" Windows" )
129
+ }
130
+ }
131
+
132
+ function Get-OSName {
133
+ [Microsoft.Azure.PowerShell.Cmdlets.Aks.DoNotExportAttribute ()]
134
+ param (
135
+ )
136
+ process {
137
+ if ($PSVersionTable.PSEdition.Contains (" Core" )) {
138
+ $OSPlatform = $PSVersionTable.OS
139
+ } else {
140
+ $OSPlatform = $env: OS
141
+ }
142
+ return $OSPlatform
143
+ }
144
+ }
123
145
Function Install-Kubectl
124
146
{
125
147
[Microsoft.Azure.PowerShell.Cmdlets.Aks.DoNotExportAttribute ()]
@@ -163,7 +185,7 @@ Function Install-Kubectl
163
185
$url = " $baseUrl /stable.txt"
164
186
$Version = (Invoke-WebRequest - Uri $url ).Content.Trim()
165
187
}
166
- If ($ IsWindows )
188
+ If (IsWindows)
167
189
{
168
190
$destFilePath = [System.IO.Path ]::Combine($Destination , " kubectl.exe" )
169
191
$downloadFileUrl = " $baseUrl /$Version /bin/windows/amd64/kubectl.exe"
@@ -258,7 +280,7 @@ Function Install-Kubelogin
258
280
$Version = $latestVersionInfo.tag_name.Trim ()
259
281
}
260
282
$downloadFileUrl = " $baseDownloadUrl /$Version /kubelogin.zip"
261
- If ($ IsWindows )
283
+ If (IsWindows)
262
284
{
263
285
$subDir = " windows_amd64"
264
286
$binaryName = " kubelogin.exe"
Original file line number Diff line number Diff line change 18
18
- Additional information about change #1
19
19
-->
20
20
## Upcoming Release
21
+ * Fixed the issue that system variable ` $IsWindows ` is undefined in ` Windows PowerShell ` .
21
22
* Decoupled AutoMapper dependency, replaced with AdapterHelper.
22
23
23
24
## Version 5.3.1
You can’t perform that action at this time.
0 commit comments