Help with "NetSecurity"

Hi,

New to PS and trying to follow along a tutorial which runs the Get-NetFirewallRule command. Seems I do not have the module installed. After searching it seems this is part of the NetSecurity packages, but I do not have this package installed. Attempted to install it, but it failed. Looking for guidance on what to do next?

PS H:> Get-Module NetSecurity -ListAvailable

PS H:> Install-Module NetSecurity
PackageManagement\Install-Package : No match was found for the specified search criteria and module name ‘NetSecurity’. Try
Get-PSRepository to see all available registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21

  • … $null = PackageManagement\Install-Package @PSBoundParameters
  • CategoryInfo : ObjectNotFound: (Microsoft.Power…InstallPackage:InstallPackage) [Install-Package], Exception
  • FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

PS H:> Get-PSRepository

Name InstallationPolicy SourceLocation


PSGallery Untrusted https://www.powershellgallery.com/api/v2

As far as I remember it comes with the RSAT package. Once you installed this it should be available.

Hi,

RSAT also fails

PS H:> Install-Module RSAT
PackageManagement\Install-Package : No match was found for the specified search criteria and module name ‘RSAT’. Try Get-PSRepository
to see all available registered module repositories.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21

  • … $null = PackageManagement\Install-Package @PSBoundParameters
  • CategoryInfo : ObjectNotFound: (Microsoft.Power…InstallPackage:InstallPackage) [Install-Package], Exception
  • FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

 

In another desktop which has a functioning NetFirewallRules I see NetSecurity and no RSAT.

Any risk in copying the folder C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\NetSecurity from the system that works to the one that does not?

 

PS C:\WINDOWS\system32> Get-Module NetSecurity -ListAvailable

Directory: C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules

ModuleType Version Name ExportedCommands


Manifest 2.0.0.0 NetSecurity {Get-DAPolicyChange, New-NetIPsecAuthProposal, New-NetIPsecMainModeCryptoProposal, New-NetIPsecQuickModeCrypto…

PS C:\WINDOWS\system32> Get-Module RSAT -ListAvailable

RSAT is not a Powershell Module. It is a Windows Optional Feature.