-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInstall-Sysinternals.ps1
More file actions
38 lines (30 loc) · 1.02 KB
/
Install-Sysinternals.ps1
File metadata and controls
38 lines (30 loc) · 1.02 KB
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
function Install-Sysinternals {
$url = New-Object Uri('http://download.sysinternals.com/files/SysinternalsSuite.zip')
$output = Join-Path $PSScriptRoot '..\sysinternals'
$zip = Join-Path $PSScriptRoot '..\sysinternals\sysinternals.zip'
if(Test-Path $output) {
$choices = [System.Management.Automation.Host.ChoiceDescription[]] @("&Yes", "&No")
$choice = $host.UI.PromptForChoice('Overwrite Confirmation', 'Sysinternals directory already exists. Want to overwrite it?', $choices, 1)
if($choice -ne 0) {
return;
}
}
else {
mkdir $output | out-null
}
if(-not(Test-Path($zip))) {
Download-File $url -OutFile $zip
}
try {
pushd $output
unzip -o sysinternals.zip
if($?) {
rm $zip
$output = cvpa $output
Write-Host "Sysinternals tools unpacked at $output. Reload PSUtils module to get its aliases setted." -ForegroundColor Yellow
}
}
finally {
popd
}
}