Help with “NetSecurity”

Welcome Forums General PowerShell Q&A Help with “NetSecurity”

  • This topic has 3 replies, 2 voices, and was last updated 2 months ago by
    Participant
    .
Viewing 3 reply threads
  • Author
    Posts
    • #212652
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      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

    • #212655
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP

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

    • #212661
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      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

    • #212667
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP

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

Viewing 3 reply threads
  • You must be logged in to reply to this topic.