From cad81075d73e3bcc76f1cdcd7d0ce6f7967058d8 Mon Sep 17 00:00:00 2001 From: metablaster <44481081+metablaster@users.noreply.github.com> Date: Thu, 22 Dec 2022 17:20:25 +0100 Subject: [PATCH] suppress an error for directory not found --- .vscode/bookmarks.json | 60 +++++++++++++++++++ .../Private/Restore-NetProfile.ps1 | 1 + .../Private/Unblock-NetProfile.ps1 | 1 + .../Public/Enable-WinRMServer.ps1 | 3 + .../Ruleset.Remote/Public/Set-WinRMClient.ps1 | 3 + .../Development/Microsoft/VisualStudio.ps1 | 4 +- SECURITY.md | 4 +- docs/CHANGELOG.md | 4 +- 8 files changed, 74 insertions(+), 6 deletions(-) diff --git a/.vscode/bookmarks.json b/.vscode/bookmarks.json index caf1595a..4ca58496 100644 --- a/.vscode/bookmarks.json +++ b/.vscode/bookmarks.json @@ -139,6 +139,66 @@ "label": "" } ] + }, + { + "path": "Modules/Ruleset.Remote/Public/Set-WinRMClient.ps1", + "bookmarks": [ + { + "line": 99, + "column": 0, + "label": "" + } + ] + }, + { + "path": "Rules/IPv4/Outbound/Development/Microsoft/VisualStudio.ps1", + "bookmarks": [ + { + "line": 132, + "column": 2, + "label": "" + } + ] + }, + { + "path": "Modules/Ruleset.Remote/Private/Unblock-NetProfile.ps1", + "bookmarks": [ + { + "line": 84, + "column": 29, + "label": "" + } + ] + }, + { + "path": "Modules/Ruleset.Remote/Private/Restore-NetProfile.ps1", + "bookmarks": [ + { + "line": 80, + "column": 29, + "label": "" + } + ] + }, + { + "path": "Modules/Ruleset.Remote/Public/Enable-WinRMServer.ps1", + "bookmarks": [ + { + "line": 111, + "column": 0, + "label": "" + } + ] + }, + { + "path": "Modules/Ruleset.Initialize/Public/Initialize-Service.ps1", + "bookmarks": [ + { + "line": 261, + "column": 5, + "label": "" + } + ] } ] } \ No newline at end of file diff --git a/Modules/Ruleset.Remote/Private/Restore-NetProfile.ps1 b/Modules/Ruleset.Remote/Private/Restore-NetProfile.ps1 index 06905dcb..41ffbad2 100644 --- a/Modules/Ruleset.Remote/Private/Restore-NetProfile.ps1 +++ b/Modules/Ruleset.Remote/Private/Restore-NetProfile.ps1 @@ -77,6 +77,7 @@ function Restore-NetProfile { if ($PSCmdlet.ShouldProcess($Adapter.Key, "Restore network profile")) { + # TODO: This will remove options from settings app Set-NetConnectionProfile -InterfaceAlias $Adapter.Key -NetworkCategory $Adapter.Value } } diff --git a/Modules/Ruleset.Remote/Private/Unblock-NetProfile.ps1 b/Modules/Ruleset.Remote/Private/Unblock-NetProfile.ps1 index 5fcf217e..6b1ff98d 100644 --- a/Modules/Ruleset.Remote/Private/Unblock-NetProfile.ps1 +++ b/Modules/Ruleset.Remote/Private/Unblock-NetProfile.ps1 @@ -81,6 +81,7 @@ function Unblock-NetProfile # 0 = public # 1 = private # 2 = domain + # TODO: This will remove options from settings app Set-NetConnectionProfile -InterfaceAlias $Adapter.InterfaceAlias -NetworkCategory Private $script:AdapterProfile.Add($Adapter.InterfaceAlias, $Adapter.NetworkCategory) } diff --git a/Modules/Ruleset.Remote/Public/Enable-WinRMServer.ps1 b/Modules/Ruleset.Remote/Public/Enable-WinRMServer.ps1 index 49191863..003cfe1f 100644 --- a/Modules/Ruleset.Remote/Public/Enable-WinRMServer.ps1 +++ b/Modules/Ruleset.Remote/Public/Enable-WinRMServer.ps1 @@ -109,6 +109,9 @@ TODO: Implement -NoServiceRestart parameter if applicable so that only configura TODO: Implement specifying listening addresses and address ranges TODO: Implement parameter -SessionConfiguration with default to be built in session configuration See also output of: winrm get winrm/config +TODO: Somewhere it errors with "WinRM firewall exception will not work since one of the network connection types on this machine is set to Public. +Change the network connection type to either Domain or Private and try again." +It seems to reproduce after Reset-Firewall -Remoting -Service, also in Set-WinRMClient .LINK https://github.com/metablaster/WindowsFirewallRuleset/blob/master/Modules/Ruleset.Remote/Help/en-US/Enable-WinRMServer.md diff --git a/Modules/Ruleset.Remote/Public/Set-WinRMClient.ps1 b/Modules/Ruleset.Remote/Public/Set-WinRMClient.ps1 index 08734e04..0d19699e 100644 --- a/Modules/Ruleset.Remote/Public/Set-WinRMClient.ps1 +++ b/Modules/Ruleset.Remote/Public/Set-WinRMClient.ps1 @@ -97,6 +97,9 @@ TODO: Parameter to apply only additional config as needed instead of hard reset HACK: Set-WSManInstance fails in PS Core with "Invalid ResourceURI format" error TODO: Implement -NoServiceRestart parameter if applicable so that only configuration is affected See also output of: winrm get winrm/config +TODO: Somewhere it errors with "WinRM firewall exception will not work since one of the network connection types on this machine is set to Public. +Change the network connection type to either Domain or Private and try again." +It seems to reproduce after Reset-Firewall -Remoting -Service, also in Enable-WinRMServer .LINK https://github.com/metablaster/WindowsFirewallRuleset/blob/master/Modules/Ruleset.Remote/Help/en-US/Set-WinRMClient.md diff --git a/Rules/IPv4/Outbound/Development/Microsoft/VisualStudio.ps1 b/Rules/IPv4/Outbound/Development/Microsoft/VisualStudio.ps1 index 1235825f..4a135818 100644 --- a/Rules/IPv4/Outbound/Development/Microsoft/VisualStudio.ps1 +++ b/Rules/IPv4/Outbound/Development/Microsoft/VisualStudio.ps1 @@ -332,12 +332,12 @@ These are not optional and are designed to be running side-by-side with devenv.e # NOTE: subdirectory name consists of version number so let's get that: # NOTE: Get-ChildItem doesn't recognize environment variables - $MSVCVersion = Get-ChildItem -Directory -Name -Path "$($Instance.InstallationPath)\VC\Tools\MSVC" + $MSVCVersion = Get-ChildItem -Directory -Name -Path "$($Instance.InstallationPath)\VC\Tools\MSVC" -ErrorAction Ignore # There should be only one directory, but just in case let's select highest version $MSVCVersion = $MSVCVersion | Select-Object -Last 1 - $Program = "$VSRoot\VC\Tools\MSVC\$script:MSVCVersion\bin\Hostx86\x64\vctip.exe" + $Program = "$VSRoot\VC\Tools\MSVC\$MSVCVersion\bin\Hostx86\x64\vctip.exe" if ((Test-ExecutableFile $Program) -or $ForceLoad) { New-NetFirewallRule -DisplayName "$($DisplayName) VCTIP telemetry" ` diff --git a/SECURITY.md b/SECURITY.md index d1d474c6..57b31ee0 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -12,8 +12,8 @@ The following version of `Windows Firewall Ruleset` are eligible for security re | Version | Supported | | ------- | ----------| -| 0.14.0 | ✓ | -| 0.15.0 | ✓ | +| 0.14.x | ✓ | +| 0.15.x | ✓ | ## The difference between privacy and security diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 2c0ef025..7ed78342 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -7,7 +7,7 @@ Here is a list of changes for each of the releases. - [Changelog](#changelog) - [Table of Contents](#table-of-contents) - - [v0.15.0 (develop branch)](#v0150-develop-branch) + - [v0.14.1 (develop branch)](#v0141-develop-branch) - [v0.14.0 (current release)](#v0140-current-release) - [v0.13.1](#v0131) - [v0.13.0](#v0130) @@ -24,7 +24,7 @@ Here is a list of changes for each of the releases. - [v0.3.0](#v030) - [v0.2](#v02) -## v0.15.0 (develop branch) +## v0.14.1 (develop branch) To see unreleased changes please do so on `develop` branch [HERE][changelog]\ **NOTE:** Changes for unreleased version may change or be announced upfront