Check if a Program Is Installed With PowerShell 3

<# Returns true if a program with the specified display name is installed. This function will check both the regular Uninstall location as well as the "Wow6432Node" location to ensure that both 32-bit and 64-bit locations are checked for software installations. @param String $program The name of the program to check for. @return Booleam Returns true if a program matching the specified name is installed. #> function Is-Installed( $program ) { $x86 = ((Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall") | Where-Object { $_.GetValue( "DisplayName" ) -like "*$program*" } ).Length -gt 0; $x64 = ((Get-ChildItem "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall") | Where-Object { $_.GetValue( "DisplayName" ) -like "*$program*" } ).Length -gt 0; return $x86 -or $x64; }

Merge WSUS Updates Into a WIM Image Using PowerShell 3.0

# The path to the WIM Image file $imagePath = "C:\\users\\administrator\\desktop\\windows7.wim" # The path to the root of your WSUS Content $wsusContent = "C:\\WSUS\WsusContent" # The index in the WIM file to the OS image you want to mount. $imageIndex = 1 # The directory where you want to mount the WIM Image $mountPath = "C:\\Mount" # Mount the WIM Image to the mount point specified, Mount-WindowsImage -ImagePath $imagePath -Index $imageIndex -Path $mountPath -Optimize # Get a list of all subdirectories under WsusContent $paths = Get-ChildItem $wsusContent -Directory # Iterate through each WsusContent subdirectory and attempt to add all # Windows Packages found there. foreach( $item in $paths ) { Add-WindowsPackage -Path $mountPath -PackagePath $wsusContent\$item -IgnoreCheck } # Save and dismount the Windows image. Dismount-WindowsImage -Path $mountPath -Save

This is a title