Here are some hany tricks!
Get all available commands
Get-Command -CommandType Cmdlet
Disk management
Get-Disk
Get-Partition
Get-Volume
Resize to max
$size = (Get-PartitionSupportedSize –DiskNumber 0 –PartitionNumber 3)
Resize-Partition -DiskNumber 0 -PartitionNumber 3 -Size $size.SizeMax
Create new partition
Initialize-Disk 1 -PartitionStyle GPT
New-Partition -DiskNumber 1 -UseMaximumSize -AssignDriveLetter
Format-Volume -DriveLetter D
change driveletter
Get-Partition -DriveLetter D | Set-Partition -NewDriveLetter E
Set new Volume Name
Set-Volume -FileSystemLabel “MAIN” -NewFileSystemLabel “”
Create network share
mkdir ISO
net share “ISO=C:\Users\Administrator\ISO” “/GRANT:EVERYONE,FULL”
Enable dedup feature
dism /Online /Get-Features
dism /Online /Enable-Feature /FeatureName:Dedup-Core /all
Enable-DedupVolume -Volume D: -UsageType HyperV
Show saved space status
Get-DedupStatus
https://technet.microsoft.com/en-us/library/hh848441.aspx
Windows Update
Check windows update
$sess = New-CimInstance -Namespace root/Microsoft/Windows/WindowsUpdate -ClassName MSFT_WUOperationsSession
$scanResults = Invoke-CimMethod -InputObject $sess -MethodName ScanForUpdates -Arguments @{SearchCriteria=”IsInstalled=0″;OnlineScan=$true}
$scanResults
Install updates
$scanResults = Invoke-CimMethod -InputObject $sess -MethodName ApplyApplicableUpdates
Cleanup afterwards (uninstall not possible after this action)
dism /online /Cleanup-Image /StartComponentCleanup /ResetBase