diff --git a/scripts/ps/makerespt.ps1 b/scripts/ps/makerespt.ps1 index 88d13a1..dfaa049 100644 --- a/scripts/ps/makerespt.ps1 +++ b/scripts/ps/makerespt.ps1 @@ -1,6 +1,6 @@ Write-Host "---Create restore point for C:\---" Checkpoint-Computer -Description "Before Sweetcade Install" -RestorePointType APPLICATION_INSTALL -if ( $? -ne True ) +if ( $? -ne $true ) { Write-Host "SC-RPT-ERR001: CANNOT CREATE RESTORE POINT" Write-Host "Creating a restore point has failed. The reason for failure should be printed above." diff --git a/scripts/ps/netcheck.ps1 b/scripts/ps/netcheck.ps1 index bf53f70..7e97a01 100644 --- a/scripts/ps/netcheck.ps1 +++ b/scripts/ps/netcheck.ps1 @@ -1,8 +1,8 @@ Function fDefaultGatewayCheck() { Write-Host "---Determine Default Gateway---" #This doesn't put out a $null value when no data is returned!!! (i.e. no network connection, all network interfaces disabled) - Get-WmiObject -Class Win32_IP4RouteTable | where { $_.destination -eq '0.0.0.0' -and $_.mask -eq '0.0.0.0' } | Sort-Object nexthop, metric1, interfaceindex - $vSCNextHop = (Get-WmiObject -Class Win32_IP4RouteTable | where { $_.destination -eq '0.0.0.0' -and $_.mask -eq '0.0.0.0' } | Sort-Object metric1 | select nexthop | Format-Wide | Out-String).trim() + Get-WmiObject -Class Win32_IP4RouteTable | Where-Object { $_.destination -eq '0.0.0.0' -and $_.mask -eq '0.0.0.0' } | Sort-Object nexthop, metric1, interfaceindex + $vSCNextHop = (Get-WmiObject -Class Win32_IP4RouteTable | Where-Object { $_.destination -eq '0.0.0.0' -and $_.mask -eq '0.0.0.0' } | Sort-Object metric1 | Select-Object nexthop | Format-Wide | Out-String).trim() #It's almost midnight and I have work tomorrow so I'm just looking for anything with numbers, maybe this could be better and look for a real IP address #Also no idea if the network resources we call later have IPv6 support but it's 2024 lol if ($vSCNextHop -contains "0123456789abcdef")