Trying to install, use and learn ShowUI and receiving error

Jan 5, 2014 at 3:34 PM
Edited Jan 5, 2014 at 5:31 PM
Hello,

I'm trying to install, use and learn the ShowUI module.

I tried following the instructions from this location:
https://showui.codeplex.com/

and followed this video: https://www.youtube.com/watch?v=cR2koin9QNA

I unzipped the ShowUI module
to:C:\Users\Tony\Documents\WindowsPowerShell\Modules

After unzipping it shows a folder inside the Modules folder of ShowUI and
inside the ShowUI folder there are two files ([Content_Types].xml,
install.cmd) and another ShowUI folder. Inside the second ShowUI
folder there are numerous other files and folders.

When I open the PowerShell ISE version 6.3.9600,16384 from
C:\Windows\System32\WindowsPowerShell\v1.0 and run “Import-Module
ShowUI” from the prompt, I get this error:

“Import-Module
: The specified module 'ShowUI' was not loaded because no valid
module file was found in any module directory.
At line:1 char:1
+
Import-Module ShowUI
  • ~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo
      : ResourceUnavailable: (ShowUI:String) [Import-Module],
      FileNotFoundException
    • FullyQualifiedErrorId :
      Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand”
I am using Windows 8.1 in a standalone laptop environment.

When I use the $PSVersionTable, I get the following
information:
Name Value

PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.34003
BuildVersion 6.3.9600.16394
PSCompatibleVersions {1.0, 2.0, 3.0,4.0}
PSRemotingProtocolVersion 2.2

I have learned what I can from here:
http://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx

and I took this course here:
http://www.microsoftvirtualacademy.com/training-courses/getting-started-with-powershell-3-0-jump-start#?fbid=zuqI2jtgHUp

Any help to resolve this issue would be gratefully appreciated.

Thanks,
Tony
Coordinator
Jan 7, 2014 at 6:51 AM
Edited Jan 7, 2014 at 7:02 AM
What on earth!? Where did you get your download? It's not this one: https://showui.codeplex.com/releases

The "[Content_Types].xml" file sounds like a NuGet/Chocolatey package thing, is someone distributing it like that? In any case, it sounds like you need to move up the inner module folder.

From what you said, it sounds like you have an extra ShowUI folder, something like: C:\Users\Tony\Documents\WindowsPowerShell\Modules\ShowUI\ShowUI\ShowUI.psd1

When a PowerShell module is properly installed you should have a MODULENAME.psd1 file inside a MODULENAME folder ... inside a folder that is in your $Env:PSModulePath

So for instance:
  1. If you type: $Env:PSModulePath -split ";"
  2. One of the lines should be C:\Users\Tony\Documents\WindowsPowerShell\Modules\
  3. In that Modules\ folder you want one folder named ShowUI
  4. in that Modules\ShowUI folder you want to see ShowUI.psd1
That is, it should be: C:\Users\Tony\Documents\WindowsPowerShell\Modules\ShowUI\ShowUI.psd1


P.S. There doesn't technically have to be a .psd1 file (the best modules will all have .psd1 files, but) it could be just a .dll or .psm1 or .cdxml file ... but it still has to have the same name as the folder, and it shouldn't be nested in further subfolders.
Jan 11, 2014 at 5:27 PM
Edited Jan 11, 2014 at 5:55 PM
Hello Jaykul.

Thanks for your help in this issue.

I wanted to make sure the problem was not my Windows 8 laptop, so I tested it on a Windows 7 32-bit Pro with Windows PowerShell 2.0 and the $PSVersionTable cmdlet shows this:
PS C:\Program Files\Microsoft Office\Office14> $PSVersionTable
Name Value
CLRVersion 2.0.50727.5472
BuildVersion 6.1.7601.17514
PSVersion 2.0
WSManStackVersion 2.0
PSCompatibleVersions {1.0, 2.0}
SerializationVersion 1.1.0.1
PSRemotingProtocolVersion 2.1

I downloaded ShowUI from your link and it gave me the same file and folder structure as I originally explained.

I copied the second ShowUI folder and its contents to the Modules folder so it looks like this:
C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ShowUI

When I use this cmdlet: Import-Module ShowUI, it gave this error:
PS C:\Program Files\Microsoft Office\Office14> Import-Module ShowUI
“Import-Module : File C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ShowUI\Get-ReferencedCommand.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:14
  • Import-Module <<<< ShowUI
    • CategoryInfo : NotSpecified: (:) [Import-Module], PSSecurityException
    • FullyQualifiedErrorId : RuntimeException,Microsoft.PowerShell.Commands.ImportModuleCommand”
The get-executionpolicy yielded this:
“PS C:\Program Files\Microsoft Office\Office14> get-executionpolicy
Restricted”

Using the information from the get-help about_signing cmdlet, I used this cmdlet: set-executionpolicy remotesigned and it yielded this:
“PS C:\Program Files\Microsoft Office\Office14> get-executionpolicy
RemoteSigned”

Again using the information from the get-help about_signing cmdlet, I followed this:
To run an unsigned script:
    1. Save the script file on your computer.
    2. Click Start, click My Computer, and locate the saved script file.
    3. Right-click the script file, and then click Properties.
    4. Click Unblock.
I also followed the instructions to CREATE A SELF-SIGNED CERTIFICATE and to SIGN A SCRIPT, getting this result:
“PS C:\Program Files\Microsoft Office\Office14> Set-AuthenticodeSignature C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ShowUI\ShowUI.psd1 $cert
Directory: C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ShowUI
SignerCertificate Status Path
440040DA60530048F42083A66A96E176555A7BA9 Valid ShowUI.psd1

Yet when I run the Import-Module ShowUI, I get this error:
“Import-Module : There were errors in loading the format data file:
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ShowUI\ShowUI.Formats.ps1xml : File skipped because it was already present from "Microsoft.PowerShell".
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ShowUI\ShowUI.Formats.ps1xml : File skipped because it was already present from "Microsoft.PowerShell".
At line:1 char:14
  • Import-Module <<<< ShowUI
    • CategoryInfo : InvalidOperation: (:) [Import-Module], RuntimeException
    • FullyQualifiedErrorId : FormatXmlUpateException,Microsoft.PowerShell.Commands.ImportModuleCommand
I then ran this: PS C:\Program Files\Microsoft Office\Office14> Set-AuthenticodeSignature C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ShowUI*.ps1xml $cert

And got this result:
“Directory: C:\Windows\System32\WindowsPowerShell\v1.0\Modules\ShowUI
SignerCertificate Status Path
440040DA60530048F42083A66A96E176555A7BA9 Valid ShowUI.Formats.ps1xml

Then ran this again: Import-Module ShowUI and got this result:
Import-Module : There were errors in loading the format data file:
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ShowUI\ShowUI.Formats.ps1xml : File skipped because it was already present from "Microsoft.PowerShell".
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ShowUI\ShowUI.Formats.ps1xml : File skipped because it was already present from "Microsoft.PowerShell".
Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ShowUI\ShowUI.Formats.ps1xml : File skipped because it was already present from "Microsoft.PowerShell".
At line:1 char:14
  • Import-Module <<<< ShowUI
    • CategoryInfo : InvalidOperation: (:) [Import-Module], RuntimeException
    • FullyQualifiedErrorId : FormatXmlUpateException,Microsoft.PowerShell.Commands.ImportModuleCommand
I didn’t think it would be this hard to start using PowerShell.

Are my systems so weird that it is keeping me from getting ShowUI to run?

Thanks,
Tony
Coordinator
Jan 13, 2014 at 4:23 AM
You don't need to mess with code-signing unless you're in a corporate environment where it's required, just run PowerShell "As Administrator" once, and set the policyt to allow scripts to run: Set-ExecutionPolicy RemoteSigned or even Set-ExecutionPolicy Unrestricted

The second error you got is a bug in PowerShell. When you ran Import-Module the first time, you got an error, but PowerShell partially imported the module ... once you fixed that error, when you tried again, you got errors indicating that it's not reloading the format file, because it already loaded it. That's batty and buggy, but you can probably ignore it. Certainly if you open a new PowerShell window it should work fine.