Skip to content

Commit a10bb06

Browse files
authored
Switch from Windows Powershell to pwsh (#2906)
1 parent 6981b90 commit a10bb06

10 files changed

Lines changed: 19 additions & 18 deletions

File tree

.vsts/common/set-dist-vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
steps:
2-
- powershell: $(Build.SourcesDirectory)/.vsts/common/build-vars.ps1 "$(Build.SourceBranch)" "$(Build.BuildNumber)"
2+
- pwsh: $(Build.SourcesDirectory)/.vsts/common/build-vars.ps1 "$(Build.SourceBranch)" "$(Build.BuildNumber)"
33
displayName: Resolve build info

.vsts/node-setup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ steps:
1919
echo "##vso[task.setvariable variable=npm_config_userconfig]$(Agent.TempDirectory)/.npmrc"
2020
condition: ne( variables['Agent.OS'], 'Windows_NT' )
2121
displayName: Set NPM userconfig (Linux/MacOS)
22-
- powershell: |
22+
- pwsh: |
2323
Write-Host "##vso[task.setvariable variable=npm_config_userconfig]$env:AGENT_TEMPDIRECTORY\.npmrc"
2424
condition: eq( variables['Agent.OS'], 'Windows_NT' )
2525
displayName: Set NPM userconfig (Windows)

.vsts/python-setup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ steps:
1919
condition: ne( variables['Agent.OS'], 'Windows_NT' )
2020
displayName: Install Python dependencies (Linux)
2121
22-
- powershell: |
22+
- pwsh: |
2323
. .vsts/win/exec.ps1
2424
$ErrorActionPreference = "Stop"
2525
$(Agent.WorkFolder)\.venv\batchexplorer\Scripts\Activate.ps1

.vsts/win/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ steps:
22
- template: ./credscan.yml
33
- template: ./win-dependencies.yml
44

5-
- powershell: |
5+
- pwsh: |
66
$(Agent.WorkFolder)\.venv\batchexplorer\Scripts\Activate.ps1
77
npm run build:package
88
displayName: Build and package
99
10-
- powershell: |
10+
- pwsh: |
1111
. ../.vsts/win/exec.ps1
1212
$ErrorActionPreference = "Stop"
1313
$env:BE_TEST_AAD_USER_EMAIL = "$(uiTestingAccountEmail)"

.vsts/win/distribution.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ steps:
44
- template: ./win-dependencies.yml
55
- template: ../common/download-i18n-artifacts.yml
66

7-
- powershell: |
7+
- pwsh: |
88
$(System.DefaultWorkingDirectory)/Localize/copy-translations.ps1 -artifactsPath "$(Agent.BuildDirectory)/drop/loc"
99
displayName: 'Run copy-translations.ps1 with artifacts path (Windows)'
1010
11-
- powershell: |
11+
- pwsh: |
1212
$version = npm run -s ts scripts/package/get-version
1313
Write-Host "Updating build number to $version"
1414
Write-Host "##vso[build.updatebuildnumber]$version"
1515
workingDirectory: desktop
1616
displayName: Update build version for packaging
1717
18-
- powershell: |
18+
- pwsh: |
1919
. .vsts/win/exec.ps1
2020
$ErrorActionPreference = "Stop"
2121
$(Agent.WorkFolder)\.venv\batchexplorer\Scripts\Activate.ps1
2222
exec { npm run build:prod }
2323
displayName: Build all packages
2424
25-
- powershell: |
25+
- pwsh: |
2626
. ../.vsts/win/exec.ps1
2727
$ErrorActionPreference = "Stop"
2828
$(Agent.WorkFolder)\.venv\batchexplorer\Scripts\Activate.ps1
@@ -41,7 +41,7 @@ steps:
4141
**/*.dll
4242
!**/python36.dll
4343
44-
- powershell: npm run package win-installer
44+
- pwsh: npm run package win-installer
4545
workingDirectory: desktop
4646
displayName: Build installer
4747

@@ -51,7 +51,7 @@ steps:
5151
pattern: |
5252
**/BatchExplorer*Setup*.exe
5353
54-
- powershell: npm run package win-manifest
54+
- pwsh: npm run package win-manifest
5555
workingDirectory: desktop
5656
displayName: Create manifest
5757
- template: ../common/generate-sbom.yml

.vsts/win/win-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
steps:
22
- template: ../dependencies.yml
3-
- powershell: |
3+
- pwsh: |
44
. .vsts/win/exec.ps1
55
$ErrorActionPreference = "Stop"
66
exec { Write-Host "Node.js version" $(node --version) }

desktop/scripts/docker/windows/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ENV GIT_VERSION 2.17.1
1010

1111
LABEL Description="BatchLabs image for building for windows" Maintainer="batchexplorer@microsoft.com" Version="${node_version}"
1212

13-
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
13+
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
1414

1515
# Install node
1616
ADD https://nodejs.org/dist/v${node_version}/node-v${node_version}-win-x64.zip C:/build/node.zip

desktop/scripts/proxy/virtual-machine.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ resource windowsVMExtensions 'Microsoft.Compute/virtualMachines/extensions@2020-
8888
fileUris: [
8989
'https://raw.githubusercontent.com/Azure/BatchExplorer/main/scripts/proxy/initVirtualMachine.ps1'
9090
]
91-
commandToExecute: 'powershell -ExecutionPolicy Bypass -File initVirtualMachine.ps1 -Address ${proxyServer} -Port ${proxyPort} -Build ${batchExplorerBuild}'
91+
commandToExecute: 'pwsh -ExecutionPolicy Bypass -File initVirtualMachine.ps1 -Address ${proxyServer} -Port ${proxyPort} -Build ${batchExplorerBuild}'
9292
}
9393
}
9494
}

docs/setup.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ The following are instructions for building and running Batch Explorer in a deve
66

77
Make sure the following are installed:
88

9-
- Node.js 18 or higher
10-
- Python 3.6 or higher
9+
- Node.js LTS
10+
- Python 3.6+
11+
- Powershell 7+
1112

1213
**On Windows:**
1314

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
"lint": "prettier -c . && lerna run --parallel workspace:lint --stream && npm run -s lint:markdown",
7373
"lint:fix": "prettier -w . && lerna run --parallel workspace:lint:fix --stream && npm run -s lint:markdown",
7474
"lint:markdown": "markdownlint-cli2 \"**/*.md\" \"#**/node_modules/**/*\" \"#SECURITY.md\"",
75-
"loc:build": "powershell -ExecutionPolicy Bypass -File ./Localize/build.ps1 && powershell -ExecutionPolicy Bypass -File ./Localize/copy-translations.ps1",
76-
"loc:restore": "cd Localize && powershell -ExecutionPolicy Bypass -File restore.ps1",
75+
"loc:build": "pwsh -ExecutionPolicy Bypass -File ./Localize/build.ps1 && pwsh -ExecutionPolicy Bypass -File ./Localize/copy-translations.ps1",
76+
"loc:restore": "cd Localize && pwsh -ExecutionPolicy Bypass -File restore.ps1",
7777
"start": "npm run -s start:web",
7878
"start:desktop": "lerna run --parallel workspace:start:desktop --stream",
7979
"start:web": "lerna run --parallel workspace:start:web --stream",

0 commit comments

Comments
 (0)