This project is read-only.
2
Vote

Command Designer can't find its module

description

When I launch command designer, I get the following error:
 
Errors importing the .\PsSpecCmdlets.dll module.
The specified module 'CommandDesigner' was not loaded because no valid module file was found in any module directory.
Please see http://psstudio.codeplex.com for further assistance.
 
I don't see any module definitions for CommandDesigner, although I do see the PsSpecCmdlets.dll.

comments

oisin wrote Apr 9, 2010 at 2:29 AM

Several people are experiencing this but I cannot repro. It appears the app cannot create the module. Here's the inline script that tries to create the module (and it succeeds for many people, just not you and a handful of others.)

param([string]$path, [string]$manifest)
$psScriptRoot= ""$home\Documents\WindowsPowerShell\Modules\CommandDesigner""
New-Item $psScriptRoot -type Directory -Force | Out-Null
[IO.File]::WriteAllText(""$psScriptRoot\CommandDesigner.psd1"", $manifest)
$modulePath = ""$psScriptRoot\CommandDesigner.psm1""
if ((Test-Path $modulePath -ErrorAction SilentlyContinue)) {
$oldLines = Get-Content $modulePath
$newLines = New-Object Text.StringBuilder
foreach ($line in $oldLines) {
    if ($line -notlike 'Import-Module ''*\PsSpecCmdlets.dll''') {
        $null = $newLines.Append($line)
        $null = $newLines.Append([Environment]::NewLine)
    } else {
        $null = $newLines.Append(""Import-Module '$path\PsSpecCmdlets.dll'"")
        $null = $newLines.Append([Environment]::NewLine)
    }
}
[IO.File]::WriteAllText($modulePath, $newLines)        
} else {
[IO.File]::WriteAllText($modulePath, ""Import-Module '$path\PsSpecCmdlets.dll'"")
}
$Culture = Get-Culture
New-Item ""$psScriptRoot\$culture"" -type Directory -Force | Out-Null

Get-ChildItem $Path -Filter '*-Help.xml' -ErrorAction SilentlyContinue |
Copy-Item -Destination ""$psScriptRoot\$culture\"" -Force | 
Out-Null
Thanks Lee. Btw, the app dumps a file called "environment.htm" with the app's runtime notion of the environment block. This might help figure it out? Is your home directory redirected to the network by any chance?

TristinDavis wrote Apr 15, 2011 at 7:49 PM

I"m also getting the same error. I've tried the module on Server 2008, Windows 7, and Server 2003. All have the same result. Has anyone actually gotten this application to work?

wrote Feb 12, 2013 at 11:35 PM

wrote Mar 6, 2013 at 5:13 AM