Skip to content

Commit

Permalink
Changed -pollperiod default to 60
Browse files Browse the repository at this point in the history
Can now be run with no parameters
  • Loading branch information
guyrleech committed Sep 3, 2019
1 parent 3118d69 commit b20e407
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Network Profile Actioner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The value to set in the registry value when the network profiles are connected a
.PARAMETER pollPeriod
The time in seconds to wait between checks. By default the script will only run once
The time in seconds to wait between checks. If set to zero then the script will only run once
.PARAMETER noAdminCheck
Expand All @@ -53,13 +53,13 @@ The string to match when no traffic is flowing over the given interface (do not
.EXAMPLE
& '.\Network Profile Actioner.ps1' -Verbose -pollPeriod 60 -logFile c:\temp\iper.log
& '.\Network Profile Actioner.ps1' -Verbose -logFile c:\temp\iper.log
Check the network connection profiles every 60 seconds and make the required changes to the registry value, writing to a log file c:\temp\iper.log
Check the network connection profiles every 60 seconds (the default) and make the required changes to the registry value, writing to a log file c:\temp\iper.log
.EXAMPLE
& '.\Network Profile Actioner.ps1'
& '.\Network Profile Actioner.ps1' -pollPeriod 0
Check the network connection profiles once and make the required changes to the registry value and then exit
Expand All @@ -74,7 +74,7 @@ Param
[string]$awayNetworks = 'Public' ,
[int]$homeValue = 1 ,
[int]$awayValue = 3 ,
[int]$pollPeriod = 0 ,
[int]$pollPeriod = 60 ,
[switch]$noAdminCheck ,
[string]$logFile ,
[string]$noTraffic = 'NoTraffic'
Expand Down Expand Up @@ -146,7 +146,7 @@ Try
$previousValue = $atHome
}

if( $PSBoundParameters[ 'pollPeriod' ] )
if( $pollPeriod -gt 0 )
{
Start-Sleep -Seconds $pollPeriod
}
Expand Down

0 comments on commit b20e407

Please sign in to comment.