Useful PowerShell commands
These are the PowerShell commands I frequently use when deploying a new Windows server.
#Enable Ping
Set-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request – ICMPv4-In)" -enabled True

#Get InterfaceIndex value
Get-NetAdapter -Name * | Format-Table –AutoSize

#Configure static IP - Use the InterfaceIndex value from the command above.
New-NetIPAddress –InterfaceIndex 5 –IPAddress -PrefixLength 24 -DefaultGateway

#Configure DNS - Again, use the same InterfaceIndex value as above
Set-DnsClientServerAddress -InterfaceIndex 6 -ServerAddresses ("","")

#Check IP address settings

#Rename computer and join domain
Add-Computer -Credential Admin-Username -DomainName -NewName Server-001; Restart-Computer -force

#Empty recycle bin
Clear-RecycleBin -DriveLetter C -Force

#Find computer name