EvotecIT / Testimo

Testimo is a PowerShell module for running health checks for Active Directory against a bunch of different tests
MIT License
526 stars 58 forks source link

Unable to find type [stirng] #91

Closed mikeoke closed 4 years ago

mikeoke commented 4 years ago

When I lookup commands in Powershell I get the following error

Windows PowerShell ISE - Error

Failed to import the module required by command "Get-TestimoSources". Module name: "Testimo". Error message: "Unable to find type [stirng].".

OK

Also with the other modules same [STIRNG] error Failed to import the module required by command "Get-TestimoConfiguration". Failed to import the module required by command "Invoke-Testimo".

PrzemyslawKlys commented 4 years ago

You need to provide more details.

  1. How did you install Testimo?
  2. Which version?
  3. How are you trying to use it?
  4. What errors exactly are you getting? Which line etc?
mikeoke commented 4 years ago

You need to provide more details. Sorry I am new to GitHub and try to give you more info below with printscreen.

How did you install Testimo? Install-Module -Name Testimo -AllowClobber -Force

Which version? Update-Module -Name Testimo [Current: 0.0.36]

How are you trying to use it? Powershell ISE on Server 2016 [i][Testimo] Version [Informative] [Current: 0.0.36] [i][Testimo] Using configuration defaults [Informative] [No configuration provided by user] [i][Forest] Forest [Informative]

What errors exactly are you getting? Which line etc? I will attach printscreen Testimo-Knipsel In this Printscreen when I click "Show Details" I got this error. I use Powershell this way so I can type extra commands in de Details and RUN command

PrzemyslawKlys commented 4 years ago

Could it be that you have more than one testimo release get-module -listavailable Testimo ?

pmormr commented 4 years ago

@PrzemyslawKlys I remember seeing the same thing but ended up switching to VS Code when I saw ISE was being deprecated as I researched. It's specifically when you pop open that autofill/help module. It's possible you typo'd a typecast somewhere but I'm not finding "stirng" anywhere in the Testimo code at least. Maybe an ISE bug?

PrzemyslawKlys commented 4 years ago

Maybe older release is present with this bug?

PrzemyslawKlys commented 4 years ago

I also got this error:

image

This can be solved with:

Import-Module ActiveDirectory

The other problem comes from PSSharedGoods:

function Get-ComputerServices {
    [CmdletBinding()]
    param([stirng] $ComputerName = $Env:COMPUTERNAME)
    $Services = Get-PSService -ComputerName $ComputerName | Select-Object Name, Displayname, Status
    return $Services
}
PrzemyslawKlys commented 4 years ago

Update-Module Testimo should fix it. I will also change in new version to fix the adaccount issue.

PrzemyslawKlys commented 4 years ago

Actually I'll keep it open till that's fixed.

mikeoke commented 4 years ago

Thank you both for helping. I am glad you found a solution. When I use powershell its almost always in Powershell ISE but with Testimo it also works directly, I am happy and got a nice Report and some work to do. Thanks!

PrzemyslawKlys commented 4 years ago

This PSD1 change fixes it.

https://github.com/EvotecIT/Testimo/blob/2b8c049cd775e34e9ed6ef059f93a699108116d7/Testimo.psd1#L16

And

https://github.com/EvotecIT/Testimo/blob/2b8c049cd775e34e9ed6ef059f93a699108116d7/Testimo.psd1#L44

Unfortunately due to New-ModuleManifest not being capable of adding PrivateData properly, I'm forced to use my own Hash for publishing and therefore the PSD1 output visually changed from original (stripped from comments mostly).