diff --git a/Includes/Core.ps1 b/Includes/Core.ps1 index fc80165b..da267819 100644 --- a/Includes/Core.ps1 +++ b/Includes/Core.ps1 @@ -999,10 +999,12 @@ Do { If (Get-Command "Get-NetFirewallRule") { If ($MissingMinerFirewallRules = (Compare-Object @(Get-NetFirewallApplicationFilter | Select-Object -ExpandProperty Program -Unique) @($Miners | Select-Object -ExpandProperty Path -Unique) -PassThru).Where({ $_.SideIndicator -eq "=>" })) { Try { + If (-not $Variables.IsLocalAdmin) { Write-Message -Level Info "Initiating request to open inbound firewall rules..." } Start-Process "pwsh" ("-Command Import-Module NetSecurity; ('$($MissingMinerFirewallRules | ConvertTo-Json -Compress)' | ConvertFrom-Json) | ForEach-Object { New-NetFirewallRule -DisplayName (Split-Path `$_ | Split-Path -leaf) -Program `$_ -Description 'Inbound rule added by $($Variables.Branding.ProductLabel) $($Variables.Branding.Version) on $([DateTime]::Now.ToString())' -Group '$($Variables.Branding.ProductLabel)' }" -replace '"', '\"') -Verb runAs + Write-Message -Level Info "Added $($MissingMinerFirewallRules.count) inbound firewall rules [Group '$($Variables.Branding.ProductLabel)']." } Catch { - Write-Message -Level Error "Request to open firewall ports declined by user." + Write-Message -Level Error "Could not add inbound firewall rules. Some miners will fail." } } Remove-Variable MissingMinerFirewallRules diff --git a/Includes/Include.psm1 b/Includes/Include.psm1 index 7ccd8738..ad7a5d47 100644 --- a/Includes/Include.psm1 +++ b/Includes/Include.psm1 @@ -2999,6 +2999,7 @@ Function Update-DAGdata { If ($Variables.DAGdata.Updated.$Url -lt $Variables.ScriptStartTime -or $Variables.DAGdata.Updated.$Url -lt [DateTime]::Now.ToUniversalTime().AddDays(-1)) { # Get block data for from whattomine.com Try { + Write-Message -Level Info "Loading DAG data from '$Url'..." $DAGdataResponse = Invoke-RestMethod -Uri $Url -TimeoutSec 5 If ($DAGdataResponse.coins.PSObject.Properties.Name) { @@ -3023,7 +3024,6 @@ Function Update-DAGdata { } ) $Variables.DAGdata.Updated | Add-Member $Url ([DateTime]::Now.ToUniversalTime()) -Force - Write-Message -Level Info "Loaded DAG data from '$Url'." } Else { Write-Message -Level Warn "Failed to load DAG data from '$Url'." @@ -3042,6 +3042,7 @@ Function Update-DAGdata { If ($Variables.DAGdata.Updated.$Url -lt $Variables.ScriptStartTime -or $Variables.DAGdata.Updated.$Url -lt [DateTime]::Now.ToUniversalTime().AddDays(-1)) { # Get block data from Minerstat Try { + Write-Message -Level Info "Loading DAG data from '$Url'..." $DAGdataResponse = Invoke-WebRequest -Uri $Url -TimeoutSec 5 # PWSH 6+ no longer supports basic parsing -> parse text If ($DAGdataResponse.statuscode -eq 200) { (($DAGdataResponse.Content -split '\n' -replace '"', "'").Where({ $_ -like "