-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"The DISM PS module needs to be installed, this can be done through the windows-adk chocolately package" #557
Comments
I just want to add my own fix for this; I'm not an expert, and i'm sure it's not up to scratch as a proper fix, but it works for me. if (Get-Module -Name DISM -ListAvailable) {
Import-Module -Name DISM
}
else {
# Correctly resolve the path to the Windows Kits directory, including handling the wildcard for version.
$baseAdkPath = "${env:ProgramFiles(x86)}\Windows Kits"
$adkVersionPaths = Get-ChildItem -Path $baseAdkPath -Directory | Where-Object { $_.Name -match '^\d+' } | Select-Object -ExpandProperty FullName
$moduleImported = $false
foreach ($versionPath in $adkVersionPaths) {
$adkDismPath = "$versionPath\Assessment and Deployment Kit\Deployment Tools\amd64\DISM"
$dismModulePath = Join-Path -Path $adkDismPath -ChildPath "DISM.psd1"
if (Test-Path $dismModulePath) {
Import-Module -Name $dismModulePath -ErrorAction SilentlyContinue
if ($?) {
$moduleImported = $true
break
}
}
}
if (-not $moduleImported) {
Fail-Json $result "The DISM PS module needs to be installed, this can be done through the windows-adk chocolately package"
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SUMMARY
Getting the message "The DISM PS module needs to be installed, this can be done through the windows-adk chocolately package" even when the module has been installed - using Chocolatey.
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
Other info - the suggested version of windows-adk is no longer available on Chocolatey (
So deleted the 'version' line and let it install the latest version.
This appears to be the problematic part of the module:
The path certainly does exist.
EXPECTED RESULTS
Expect to apply hotfix to my Windows Server 2008r2 server.
ACTUAL RESULTS
"The DISM PS module needs to be installed, this can be done through the windows-adk chocolately package"
The text was updated successfully, but these errors were encountered: