@@ -15,19 +15,7 @@ function colorize(string, color) {
1515async function installCLI ( ) {
1616 core . startGroup ( 'Installing IBM Cloud CLI' )
1717 if ( process . platform == 'win32' ) {
18- // Download the script to a local file
19- await exec . exec ( `powershell -command "(New-Object Net.WebClient).DownloadString('https://clis.cloud.ibm.com/install/powershell') | Out-File -FilePath ibmcloud_install.ps1"` )
20- // Add @echo on as the first line
21- await exec . exec ( `powershell -command "'Set-PSDebug -Trace 2' + [Environment]::NewLine + (Get-Content -Path ibmcloud_install.ps1 -Raw) | Set-Content -Path ibmcloud_install.ps1"` )
22- // Insert the new line at line 60
23- await exec . exec ( `powershell -command "$content = Get-Content -Path ibmcloud_install.ps1; $content[59] = $content[59] + [Environment]::NewLine + 'Write-Host $downloadUrl'; $content | Set-Content -Path ibmcloud_install.ps1"` )
24- // Try a new download method
25- await exec . exec ( `powershell -command "$content = Get-Content -Path ibmcloud_install.ps1; $content[61] = '(New-Object System.Net.WebClient).DownloadFile($downloadUrl, $DownloadedInstaller)'; $content[62] = ''; $content[63] = ''; $content | Set-Content -Path ibmcloud_install.ps1"` )
26- // Print out the script content for debugging
27- core . info ( 'Contents of the modified script:' )
28- await exec . exec ( `powershell -command "Get-Content -Path ibmcloud_install.ps1 | ForEach-Object { Write-Output $_ }"` )
29- // Execute the modified script
30- await exec . exec ( `powershell -File ibmcloud_install.ps1` )
18+ await exec . exec ( `powershell -command "iex (New-Object Net.WebClient).DownloadString('https://clis.cloud.ibm.com/install/powershell')"` )
3119 // Add to PATH for the current step
3220 process . env . PATH += ';C:\\Program Files\\IBM\\Cloud\\bin'
3321 // Add to GITHUB_PATH for future steps
0 commit comments