Skip to content

Commit

Permalink
test deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
metablaster committed Jan 30, 2022
1 parent 69ed60d commit 495fe6d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
1 change: 1 addition & 0 deletions Modules/Ruleset.ComputerInfo/Public/Test-Computer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ function Test-Computer

Write-Debug -Message "[$($MyInvocation.InvocationName)] ParameterSet = $($PSCmdlet.ParameterSetName):$($PSBoundParameters | Out-String)"

# TODO: Run Deploy-Firewall (will will disconnect and remove CIM) and then this will fail
if (Get-CimSession -Name RemoteCim)
{
$Status = $CimServer.TestConnection()
Expand Down
2 changes: 1 addition & 1 deletion Modules/Ruleset.Firewall/Public/Export-FirewallRule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -394,5 +394,5 @@ function Export-FirewallRule
}
}

Write-Information -Tags $MyInvocation.InvocationName -MessageData "INFO: Exporting firewall rules into: '$FileName' done"
Write-Information -Tags $MyInvocation.InvocationName -MessageData "INFO: Exporting firewall rules into '$FileName' done"
}
2 changes: 1 addition & 1 deletion Modules/Ruleset.Firewall/Public/Export-RegistryRule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -321,5 +321,5 @@ function Export-RegistryRule
}
}

Write-Information -Tags $MyInvocation.InvocationName -MessageData "INFO: Exporting firewall rules into: '$FileName' done"
Write-Information -Tags $MyInvocation.InvocationName -MessageData "INFO: Exporting firewall rules into '$FileName' done"
}
2 changes: 1 addition & 1 deletion Modules/Ruleset.ProgramInfo/Public/Search-Installation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function Search-Installation
}
"XTU"
{
Edit-Table "%ProgramFiles(x86)%\Intel\Intel(R) Extreme Tuning Utility\Client"
Edit-Table "%ProgramFiles%\Intel\Intel(R) Extreme Tuning Utility\Client"
break
}
"Chocolatey"
Expand Down
26 changes: 12 additions & 14 deletions Modules/Ruleset.ProgramInfo/Public/Test-FileSystemPath.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,15 @@ function Test-FileSystemPath
)

Write-Debug -Message "[$($MyInvocation.InvocationName)] ParameterSet = $($PSCmdlet.ParameterSetName):$($PSBoundParameters | Out-String)"
function Write-Conditional
{
# TODO: Convert to script block
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
"PSProvideCommentHelp", "", Scope = "Function", Justification = "Self explanatory function")]

$InvocationInfo = $MyInvocation.InvocationName
$WriteConditional = {
param ([string] $Message)

if ($Quiet)
{
# Make sure -Quiet switch does not make troubleshooting hard
Write-Debug -Message "[$($MyInvocation.InvocationName)] $Message"
Write-Debug -Message "[$InvocationInfo] $Message"
}
else
{
Expand All @@ -150,7 +148,7 @@ function Test-FileSystemPath
}
else
{
Write-Warning -Message "[$($MyInvocation.InvocationName)] $Message"
Write-Warning -Message "[$InvocationInfo] $Message"
}

Write-Information -Tags $MyInvocation.InvocationName -MessageData "INFO: Path '$LiteralPath'"
Expand All @@ -159,7 +157,7 @@ function Test-FileSystemPath

if ([string]::IsNullOrEmpty($LiteralPath))
{
Write-Conditional "The path name is null or empty"
& $WriteConditional "The path name is null or empty"
return $false
}

Expand Down Expand Up @@ -217,7 +215,7 @@ function Test-FileSystemPath
{
if ($IsUserProfile)
{
Write-Conditional "A Path with environment variable which leads to user profile is not valid for firewall"
& $WriteConditional "A Path with environment variable which leads to user profile is not valid for firewall"
return $false
}

Expand All @@ -230,7 +228,7 @@ function Test-FileSystemPath
{
if ($RegexVariable.Value -notin $WhiteList)
{
Write-Conditional "Specified environment variable was not whitelisted for firewall"
& $WriteConditional "Specified environment variable was not whitelisted for firewall"
return $false
}

Expand All @@ -241,21 +239,21 @@ function Test-FileSystemPath
{
if ($Qualifier -notmatch "^[A-Za-z]:\\")
{
Write-Conditional "The path qualifier '$Qualifier' is not valid for firewall rules"
& $WriteConditional "The path qualifier '$Qualifier' is not valid for firewall rules"
return $false
}
}
else
{
Write-Conditional "File system qualifier is required for firewall rules"
& $WriteConditional "File system qualifier is required for firewall rules"
return $false
}
}

# NOTE: Public folder and it's subdirectories are not user profile
if (!$IsUserProfile -and $UserProfile -and ($ExpandedPath -notmatch "^(($env:SystemDrive\\?)|\\)Users(?!\\+(Public$|Public\\+))\\"))
{
Write-Conditional "The path does not lead to user profile"
& $WriteConditional "The path does not lead to user profile"
return $false
}
}
Expand Down Expand Up @@ -289,6 +287,6 @@ function Test-FileSystemPath
}
}

Write-Conditional $Status
& $WriteConditional $Status
return $false
}
1 change: 1 addition & 0 deletions Readme/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ If you would like to see fresh changes done since last release you can do so on
- KMS Connection broker (SppExtComObj.exe)
- MSI
- Store apps
- Intel XTU

- Rule scripts, consistent rule formatting for all scripts
- Rule scripts now support Interactive and Quiet switches
Expand Down
2 changes: 1 addition & 1 deletion Rules/IPv4/Outbound/Software/Intel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ $PSDefaultParameterValues["Test-ExecutableFile:Force"] = $Trusted -or $SkipSigna
#
# Intel installation directories
#
$IntelXTURoot = "%ProgramFiles(x86)%\Intel\Intel(R) Extreme Tuning Utility\Client"
$IntelXTURoot = "%ProgramFiles%\Intel\Intel(R) Extreme Tuning Utility\Client"

# First remove all existing rules matching group
Remove-NetFirewallRule -PolicyStore $PolicyStore -Group $Group -Direction $Direction -ErrorAction Ignore
Expand Down

0 comments on commit 495fe6d

Please sign in to comment.