generated from Ash258/GenericBucket
/
PowerShell-Install.json
57 lines (57 loc) · 2.57 KB
/
PowerShell-Install.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
"version": "7.4.2",
"description": "PowerShell Core. The cross-platform task automation and configuration management framework/tool.",
"homepage": "https://github.com/PowerShell/PowerShell",
"license": "MIT",
"architecture": {
"64bit": {
"url": "https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/PowerShell-7.4.2-win-x64.msi#/setup.msi_",
"hash": "6defe662dd9e323113e8e683f604031d1e726615fb8e102c048ff52c6e9fd1e4"
},
"32bit": {
"url": "https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/PowerShell-7.4.2-win-x86.msi#/setup.msi_",
"hash": "7bf4f3459ff3edbea9e578662973f4970da313b43c5e72d1c1cf010c63a95106"
}
},
"pre_download": "Assert-Administrator",
"##": [
"$processname = \"pwsh\"",
"$process = Get-Process $processname -ErrorAction SilentlyContinue",
"if ($process) {",
" $process.CloseMainWindow()",
" Start-Sleep -Seconds 5",
" if (!$process.HasExited) {",
" Start-Sleep -Seconds 25",
" $process | Stop-Process -Force",
" }",
"}"
],
"installer": {
"script": [
"$programname = \"PowerShell*\"",
"$installpath = \"$dir\\setup.msi_\"",
"$ProgramFiles = [Environment]::GetFolderPath(\"ProgramFiles\")",
"$filepath = \"$ProgramFiles\\PowerShell\\7\\pwsh.exe\"",
"if(((Test-Path -Path $filepath -PathType Leaf) -eq $false) -or ((Get-Command $filepath).Version -lt [System.Version]\"$version\"))",
"{",
" Invoke-ExternalCommand msiexec -ArgumentList @('/i', \"$dir\\setup.msi_\", '/quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1') -RunAs | Out-Null",
" if(((Test-Path -Path $filepath -PathType Leaf) -eq $false) -or ((Get-Command $filepath).Version -lt [System.Version]\"$version\"))",
" {",
" exit 1",
" }",
"}",
"if (Test-Path -Path \"$dir\\setup.msi_\") { Remove-Item \"$dir\\setup.msi_\" -Force }"
]
},
"checkver": "github",
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://github.com/PowerShell/PowerShell/releases/download/v$version/PowerShell-$version-win-x64.msi#/setup.msi_"
},
"32bit": {
"url": "https://github.com/PowerShell/PowerShell/releases/download/v$version/PowerShell-$version-win-x86.msi#/setup.msi_"
}
}
}
}