This is the SJ-Build-ps1 test script

# Test-Path -Path C:\SJ_Build\PSWindowsUpdate

Function SJ-SetupPSWinUpdateFiles {
New-Item -ItemType Directory -Path "C:\SJ_Build"
Invoke-WebRequest -Uri "https://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc/file/41459/47/PSWindowsUpdate.zip" -OutFile "C:\SJ_Build\PSWindowsUpdate.zip"
Expand-Archive -LiteralPath C:\SJ_Build\PSWindowsUpdate.Zip -DestinationPath C:\Windows\System32\WindowsPowerShell\v1.0\Modules
}

# Set-ExecutionPolicy Unrestricted -Scope CurrentUser
###################################################################################################################################
#
# This sections is for functions.
# Get-Command -Module PSWindowsUpdate
#
###################################################################################################################################
Function SJ-GetWinUpdate {
Import-Module PSWindowsUpdate
Get-WindowsUpdate
}

Function SJ-InstallUpdate {
Install-WindowsUpdate
}

Function SJ-InstallFireFox {
New-Item -ItemType Directory -Path "C:\SJ_Build"
Invoke-WebRequest -Uri "https://download.mozilla.org/?product=firefox-stub&os=win&lang=en-US" -OutFile "C:\SJ_Build\Firefox Installer.exe"
Start-Process -FilePath "C:\SJ_Build\Firefox Installer.exe"
}

###################################################################################################################################
#
#Using PowerShell to find if Firefox is installed.
#
###################################################################################################################################

# *FAILED Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -eq "Firefox" }

Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize

# if ( Test-Path -Path C:\SJ_Build\ -eq "True" | Write-Host "Folder already exists.") elseif ( Write-Host "Folder is missing.")