Thanks for the reply.. I ended up using pieces from you as well as another script I found.. Bottom line I am testing for VPN connection and Wi-Fi.. In case this might help someone else in the future -
# check for Wifi/Wireless connection
$WifiCheck = Get-wmiobject -class win32_networkadapter -namespace root\CIMV2 | where-object {$_.Name -match "Wifi" -or $_.Name -match "wireless" -and $_.name -notmatch "Microsoft Virtual WiFi Miniport Adapter" -and $_.netenabled -eq $true}
$WifiCheck = [bool]$WifiCheck
if ($WifiCheck -eq 'True')
{LogWrite "An Active Wireless Connection was detected, aborting with Exit code 99"
$text="An Active Wireless Connection was detected. The Windows 10 Required Upgrade cannot continue while connected to A Wireless Network. Please disconnect from Wi-Fi and retry the upgrade from Software Center the next time you are in the office. `n`nPress OK to exit the upgrade."
ShowMessage ($text)
ExitWithCode "99"}
else
{LogWrite "Wireless Connection not detected, continuing..."}
# check for Cisco AnyConnect VPN
$NICS = Get-WmiObject -Query "Select Name,NetEnabled from Win32_NetworkAdapter where (Name like '%AnyConnect%') and NetEnabled='True'"
$NICS = [bool]$NICS
if ($NICS -eq 'True')
{LogWrite "Cisco AnyConnect VPN was detected, aborting with Exit code 99"
$text="Cisco AnyConnect VPN detected. The Windows 10 Required Upgrade cannot continue while connected to $CompanyName via Cisco AnyConnect VPN, please retry the upgrade from Software Center the next time you are in the office. `n`nPress OK to exit the upgrade."
ShowMessage ($text)
ExitWithCode "99"}
else
{LogWrite "Cisco AnyConnect VPN not detected, continuing..."}