You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Import-Module fails when PowerSTIG and/or dependencies are installed from a local or private repository.
The problem is that when installed through an offline NuGet package, the version number in the folder name ay be missing the build number if it is "0". For example, AccessControlDsc 1.4 is placed in "C:\Program Files\WindowsPowerShell\Modules\AccessControlDsc\1.4.0" however the PowerSTIG dependency check fails if it is not located in C:\Program Files\WindowsPowerShell\Modules\AccessControlDsc\1.4.0.0" (note the extra ".0" in the version number).
To Reproduce
Create a local repository
Register-PSRepository -Name TestRepo -SourceLocation C:\TestRepo -InstallationPolicy Trusted
Execute 'Import-Module PowerSTIG'. The import fails with the error indicating that a dependency could not be found.
Navigate to the module install directory for the dependency named in the error (in the first case it will be AccessConrolDsc located at: "C:\Program Files\WindowsPowerShell\Modules\AccessControlDsc". Rename the subfolder from "1.4.0" to "1.4.0.0"
Repeat steps 5 and 6 until import-module succeeds.
Expected behavior
Module should be imported.
Screenshots
Additional context
This is part of an effort to secure systems installed for the DoD that are public accessible but air-gapped.
The text was updated successfully, but these errors were encountered:
General-Fault
changed the title
Dependency Version Check fails for offline install
Dependency version checks fail for offline install
May 5, 2020
Describe the bug
Import-Module fails when PowerSTIG and/or dependencies are installed from a local or private repository.
The problem is that when installed through an offline NuGet package, the version number in the folder name ay be missing the build number if it is "0". For example, AccessControlDsc 1.4 is placed in "C:\Program Files\WindowsPowerShell\Modules\AccessControlDsc\1.4.0" however the PowerSTIG dependency check fails if it is not located in C:\Program Files\WindowsPowerShell\Modules\AccessControlDsc\1.4.0.0" (note the extra ".0" in the version number).
To Reproduce
Create a local repository
Register-PSRepository -Name TestRepo -SourceLocation C:\TestRepo -InstallationPolicy Trusted
Download the PowerSTIG package from PowerShell Gallery (https://www.powershellgallery.com/packages/PowerSTIG/) and copy to the local repository.
Download the PowerSTIG dependencies as NuGet packages and place them in the local repository.
https://www.powershellgallery.com/packages/AuditPolicyDsc/1.2.0.0
https://www.powershellgallery.com/packages/AuditSystemDsc/1.1.0
https://www.powershellgallery.com/packages/AccessControlDSC/1.4.0.0
https://www.powershellgallery.com/packages/ComputerManagementDsc/6.2.0.0
https://www.powershellgallery.com/packages/FileContentDsc/1.1.0.108
https://www.powershellgallery.com/packages/GPRegistryPolicyDsc/1.2.0
https://www.powershellgallery.com/packages/PSDscResources/2.10.0.0
https://www.powershellgallery.com/packages/SecurityPolicyDsc/2.4.0.0
https://www.powershellgallery.com/packages/SqlServerDsc/13.3.0
https://www.powershellgallery.com/packages/WindowsDefenderDsc/1.0.0.0
https://www.powershellgallery.com/packages/xDnsServer/1.11.0.0
https://www.powershellgallery.com/packages/xWebAdministration/2.5.0.0
Install PowerSTIG from the local repository (see also PowerShell package cannot be found in offline repository (package missing PSModule tag) #610 )
Execute 'Import-Module PowerSTIG'. The import fails with the error indicating that a dependency could not be found.
Navigate to the module install directory for the dependency named in the error (in the first case it will be AccessConrolDsc located at: "C:\Program Files\WindowsPowerShell\Modules\AccessControlDsc". Rename the subfolder from "1.4.0" to "1.4.0.0"
Repeat steps 5 and 6 until import-module succeeds.
Expected behavior
Module should be imported.
Screenshots

Additional context
This is part of an effort to secure systems installed for the DoD that are public accessible but air-gapped.
The text was updated successfully, but these errors were encountered: