Powershell Remote connection

Do you want to remove access to another computer with help of Powershell?


Test-WSMan -ComputerName Lenovo1
#This is to test if you can connect to the computer.

Enter-PSSession -ComputerName Lenovo1
#This is how you connect with powershell to that computer, user will not be effected.

Exit
#When you are done and want to kill the session/connection.


When you are connected you can navigate like in CMD if you like

cd\
#You will end up top of the file structure tree						
gwmi win32_bios
#Will fetch bios version and serial nr

ipconfig /all
#Will get all the network configuration

Hostname
#Ask what the computers name is, good way to check you are connected

GET-PSProvider
#Show all the drives on the computer

Set-Location HKCU:
#Registry HKEY_CURRENT_USER

Set-Location HKLM:
#Registry HKEY_LOCAL_MACHINE

Remove-Item
#Remove a object/file or a folder

Test-Path
#Check if drive/computer/object  is available

-erroraction silentlycontinue | Stop-Process	
#Ignore Error message and stop the process