Powershell

From UVOO Tech Wiki
Revision as of 17:02, 15 September 2020 by Busk (talk | contribs)
Jump to navigation Jump to search

Command One liners

While(1) {ps | sort -des cpu | select -f 15 | ft -a; sleep 1; cls}
robocopy <source> <destination> /mir /copyall
get-service -Name *Examp*
Get-Process -ID 1111 | Select-Object *
systeminfo | find "Virtual Memory"
stop-service, restart-service

def jtest(var):

   var2 = var + 1
   print(var2)

def jtest(var):

   var2 = var + 1
   print(var2)

Powershell security

Set-ExecutionPolicy RemoteSigned

Enable RDP

Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"

Disable RDP

Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 1
Disable-NetFirewallRule -DisplayGroup "Remote Desktop"