-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpowershell.ps1
34 lines (27 loc) · 930 Bytes
/
powershell.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
#curl equivalent
(New-Object System.Net.WebClient).DownloadString("http://www.google.com")
#wget equivalent
(New-Object System.Net.WebClient).DownloadFile(
"http://www.google.com","c:\google.html")
#(Windows Vista or Windows 7)
#Install telnet client or Server
start /w pkgmgr /iu:"TelnetClient"
start /w pkgmgr /iu:"TelnetServer"
#Remove telnet client or Server
start /w pkgmgr /uu:"TelnetClient"
start /w pkgmgr /uu:"TelnetServer"
# Start powershell script
# start Test.ps1 --> WRONG!!!
# powershell ./Test.ps1 --> WRONG!!!
# powershell "& ./Test.ps1" --> WRONG!!!
# powershell ". ./Test.ps1" --> WRONG!!!
powershell "powershell $(cat Test.ps1)"
powershell "cat Test.ps1|iex"
powershell "$(cat Test.ps1)"
powershell -ExecutionPolicy Bypass ./Test.ps1
# PS Version
[Environment]::Version
# ps
Get-Process
# get ipaddress
[System.Net.NetworkInformation.IPGlobalProperties]::GetIPGlobalProperties().GetActiveTcpListeners()