Install multiple .MSU packages

# This snippet installs all .MSU files in a given path

# Notes:
#      -Run this script / ISE as administrator
#      -Update the path for the MSU's prior to execution


# Obtain all .MSU files in a given path
$Dir = (Get-Item -Path "\\FileServer.domain.local\share" -Verbose).FullName
 
 # Loop through each .MSU file
 Foreach($Item in (ls $Dir *.msu -Name))
 {
    # Write the item to the screen so the operator know what is being worked on
    Write-Host "Starting on $Item" -ForegroundColor Magenta
    Write-Host "." 
    Write-Host "."
   
    # Use the Windows Update Standalone Installer (WUSA) to execute
    $item = $Dir + "\" + $Item
    wusa $Item /quiet /norestart | Out-Null
    Write-Host "Completed. Moving on..." -ForegroundColor Green
    Write-Host "."  
    Write-Host "." 
 }

Write-Host "Done with everything. Should probably reboot..." -ForegroundColor Green -BackgroundColor Black
pause
exit

Simple Countdown Timer

[int]$Time = Read-Host "Enter time in minutes"
$Time = $Time * 60
$Length = $Time / 100
For ($Time; $Time -gt 0; $Time--) {
$min = [int](([string]($Time/60)).split('.')[0])
$Text = " " + $min + " minutes " + ($Time % 60) + "seconds left"
Write-Progress -Activity "Waiting for..." -Status $Text -PercentComplete ($Time / $Length)
Start-Sleep 1
}

How to: Kill a VMware VM World

# SSH Into the host

# List all the VMs
esxcli vm process list

# Find the world you want to kill and copy the "VMX Cartel ID" number

# Kill the VM
esxcli vm process kill —type= [soft,hard,force] —world-id= WorldNumber