Monday, March 9, 2015

PSQTOD: PowerShell Quick Tip Of The Day

Nothing really new just some quick PowerShell one liners

Force your output to upper-case

$allservices = Get-Service
$allservices.Name.ToUpper()

#or

(Get-Service).Name.ToUpper()

Technically I needed this for a mac address so I could copy and paste into MDT (which strangely requires upper-case for a MAC address)

(Get-DhcpServerv4Lease -ComputerName DHCPServer01 -ScopeId 192.168.1.0).clientid.ToUpper()