Simple PowerShell Command

Enkla PowerShell commandon

Netbios namn
$NetBIOSName = gc env:computername > c:\temp\powershell\netbiosname.txt

Services från datorn VAIO
get-service -computer vaio | Format-List > c:\temp\powershell\services.txt

System i eventloggen från datorn VAIO
Get-EventLog system -computer vaio | format-list > c:\temp\powershell\Eventlog-System.txt

This script which check if you have a network connection and checkng all your networks addapter if anyone are connected and f it is then... else...
if (Get-WmiObject win32_networkconnection connectionstate | Where-Object {$_.connectionstate -contains "Connected"}) {
echo "Connected"
} else {
echo "Connection not found"

This script search for files in a map and a specfic text in the filename.
Get-ChildItem C:\temp\powershell\website\Test | Where-Object {$ -like "*test*"}

This script is a ping test.
If (Test-Connection -quiet) {
Write 'The host responded'}

This script search for which pocesses is run by svhost.
Get-Process | Where-Object {$_.handles -gt 200 -and $ -eq "svchost"}

get-process | Sort-Object cpu

get-service | Where-Object status -contains "stopped"


See photos from a lot of city´s in Sweden and travels around the globe.