forked from jagilber/powershellScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sysinternals-exe-download.ps1
43 lines (36 loc) · 1.35 KB
/
sysinternals-exe-download.ps1
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
<#
.SYNOPSIS
download sysinternals utilities
.LINK
[net.servicePointManager]::Expect100Continue = $true;[net.servicePointManager]::SecurityProtocol = [net.SecurityProtocolType]::Tls12;
invoke-webRequest "https://raw.githubusercontent.com/jagilber/powershellScripts/master/sysinternals-exe-download.ps1" -outFile "$pwd\sysinternals-exe-download.ps1";
.\sysinternals-exe-download.ps1
#>
param(
[ValidateSet('livekd.exe',
'psexec.exe',
'procmon.exe',
'procdump.exe',
'procexp.exe',
'tcpview.exe',
'rammap.exe',
'handle.exe',
'pipelist.exe',
'winobj.exe',
'accesschk.exe',
'disk2vhd.exe'
)]
$sysinternalsExe = "procdump.exe",
$sysinternalsCustomExe,
[switch]$noExecute
)
[net.ServicePointManager]::Expect100Continue = $true
[net.ServicePointManager]::SecurityProtocol = [net.SecurityProtocolType]::Tls12
if(!$sysinternalsCustomExe) { $sysinternalsCustomExe = $sysinternalsExe}
if(!(test-path $sysinternalsCustomExe)){
write-host "[net.webclient]::new().DownloadFile(`"http://live.sysinternals.com/$sysinternalsCustomExe`", `"$pwd\$sysinternalsCustomExe`")"
[net.webclient]::new().DownloadFile("http://live.sysinternals.com/$sysinternalsCustomExe", "$pwd\$sysinternalsCustomExe")
}
if(!$noExecute) {
. .\$sysinternalsCustomExe -accepteula
}