Skip to content

Commit

Permalink
suppress an error for directory not found
Browse files Browse the repository at this point in the history
  • Loading branch information
metablaster committed Dec 22, 2022
1 parent abe2394 commit cad8107
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 6 deletions.
60 changes: 60 additions & 0 deletions .vscode/bookmarks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": ""
}
]
}
]
}
1 change: 1 addition & 0 deletions Modules/Ruleset.Remote/Private/Restore-NetProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
1 change: 1 addition & 0 deletions Modules/Ruleset.Remote/Private/Unblock-NetProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 3 additions & 0 deletions Modules/Ruleset.Remote/Public/Enable-WinRMServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions Modules/Ruleset.Remote/Public/Set-WinRMClient.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Rules/IPv4/Outbound/Development/Microsoft/VisualStudio.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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" `
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit cad8107

Please sign in to comment.