Looking to push out a PS script to check for workstations that have a static IP address enabled however the variable always returns as True. I am sure it is something simple I am missing but I can not figure it out.
$Check = Get-NetIPInterface -ConnectionState Connected | ?{$_.InterfaceAlias -notcontains "Loopback Pseudo-Interface 1" -and $_.Dhcp -notlike "Enabled"}
If ($Check = $True) {
Write-Host "Sending Email"
}