Skip to content
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

Problem when doing the collection. #81

Closed
FinnvanDamme opened this issue May 29, 2020 · 9 comments
Closed

Problem when doing the collection. #81

FinnvanDamme opened this issue May 29, 2020 · 9 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@FinnvanDamme
Copy link

FinnvanDamme commented May 29, 2020

Running the report gives me the error below.
This error is repeated for ORCA100 to ORCA230.
Can I change something in my powershell setup to fix this?

PS VersionTable:
Name                           Value
----                           -----
PSVersion                      5.1.19041.1
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Error

Get-ORCAReport
05/29/2020 09:10:31 Performing ORCA Version check...
New-Object : Cannot find type [ORCA100]: verify that the assembly containing this type is loaded.
At line:32 char:16
return & $origNewObject @psBoundParameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

The property 'ORCAParams' cannot be found on this object. Verify that the property exists and can be set.
At C:\Program Files\WindowsPowerShell\Modules\ORCA\1.7.5\ORCA.psm1:288 char:13
 $Check.ORCAParams = $ORCAParams
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo          : InvalidOperation: (:) [], RuntimeException
FullyQualifiedErrorId : PropertyNotFound
@FinnvanDamme
Copy link
Author

I think it has something to do with the path to the checks folder. Because when i set the path manually in the Function Get-ORCACheckDefs it is doing the collection

Function Get-ORCACheckDefs
{
    Param
    (
        $ORCAParams
    )

    $Checks = @()

    # Load individual check definitions
    #$CheckFiles = Get-ChildItem "$PSScriptRoot\Checks"
    $CheckFiles = Get-ChildItem "C:\Program Files\WindowsPowerShell\Modules\ORCA\1.7.5\Checks"

@FinnvanDamme FinnvanDamme changed the title Problem with creating Problem when doing the collection. May 29, 2020
@cammurray
Copy link
Owner

That's interesting.. I wonder why $PSScriptRoot isn't set correctly for you.. I can't replicate this and haven't heard any reports of this either.

Under your $CheckFiles = Get-ChildItem, can you do a:

Write-Host Script root: $($PSScriptRoot)"

Let me know what it's being set to

@cammurray cammurray added bug Something isn't working help wanted Extra attention is needed labels May 31, 2020
@StephenFerrero
Copy link

StephenFerrero commented Jun 3, 2020

I am experiencing a similar issue, here is the output you requested:

New-Object : Cannot find type [html]: verify that the assembly containing this type is loaded.
At line:32 char:16
+         return & $origNewObject @psBoundParameters
+                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
    + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

The property 'DefaultOutputDirectory' cannot be found on this object. Verify that the property exists and can be set.
At C:\Program Files\WindowsPowerShell\Modules\ORCA\1.8.8\ORCA.psm1:401 char:17
+                 $Output.DefaultOutputDirectory = Get-ORCADirectory
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

The property 'VersionCheck' cannot be found on this object. Verify that the property exists and can be set.
At C:\Program Files\WindowsPowerShell\Modules\ORCA\1.8.8\ORCA.psm1:404 char:17
+                 $Output.VersionCheck = $VersionCheck
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

Script root: C:\Program Files\WindowsPowerShell\Modules\ORCA\1.8.8

The errors continue after the above output, for example:

New-Object : Cannot find type [ORCA100]: verify that the assembly containing this type is loaded.
At line:32 char:16
+         return & $origNewObject @psBoundParameters
+                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
    + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

The property 'ORCAParams' cannot be found on this object. Verify that the property exists and can be set.
At C:\Program Files\WindowsPowerShell\Modules\ORCA\1.8.8\ORCA.psm1:343 char:13
+             $Check.ORCAParams = $ORCAParams
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFound

@FinnvanDamme
Copy link
Author

FinnvanDamme commented Jun 4, 2020

set this at line 331:

    $CheckFiles = Get-ChildItem "$PSScriptRoot\Checks"
    Write-Host "Script root: $($PSScriptRoot)"

result:
Script root: C:\Program Files\WindowsPowerShell\Modules\ORCA\1.8.8

i checked the directory and all seams well.

    Directory: C:\Program Files\WindowsPowerShell\Modules\ORCA\1.8.8


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----          2-6-2020     09:13                Checks
d-----          2-6-2020     09:13                Outputs
-a----          1-6-2020     00:27           7306 build.json
-a----          1-6-2020     00:27          12292 ORCA.psd1
-a----          4-6-2020     09:35          26152 ORCA.psm1
-a----          1-6-2020     00:27           5841 README.md


    Directory: C:\Program Files\WindowsPowerShell\Modules\ORCA\1.8.8\Checks


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----          1-6-2020     00:27           2591 check-ORCA100.ps1
-a----          1-6-2020     00:27           2123 check-ORCA101.ps1
-a----          1-6-2020     00:27          11952 check-ORCA102.ps1
-a----          1-6-2020     00:27           5794 check-ORCA103.ps1

Seams ok?

@FinnvanDamme
Copy link
Author

FinnvanDamme commented Jun 4, 2020

i've changed line 331 to
$CheckFiles = Get-ChildItem "C:\Program Files\WindowsPowerShell\Modules\ORCA\1.8.8\Checks"
And now it does not work.. when i run the full script, but i can get results running the functions as selections..

When running the full script i'm getting the same errors as StephenFerrero.

What i did was i changed
changed line 331 to
$CheckFiles = Get-ChildItem "C:\Program Files\WindowsPowerShell\Modules\ORCA\1.8.8\Checks"

selected al of the module and did F8 tot load it.
Connected to exchange manualy

ran line 666
$Checks = Get-ORCACheckDefs -ORCAParams $ORCAParams
Checks got filled as expected

ran line 668 to 689 and all the checks ran without a problem.

@FinnvanDamme
Copy link
Author

FinnvanDamme commented Jun 4, 2020

Just to be on the safe side, i tried changing my region and language to English US.
Rebooted the laptop. Tried running the full script again.

Tried uninstalling and installing the module
Tried the Preview

No dice. Same error.

Maybe its the windows insider build im runnning?
OS Name Microsoft Windows 10 Home
Version 10.0.19041 Build 19041
Locale Netherlands

@cammurray
Copy link
Owner

Having a similar issue in Azure Cloud Shell #101 - this may resolve itself when we properly investigate and close off that one.

@HowAboutNo1
Copy link

HowAboutNo1 commented Dec 2, 2021

So, I was able to get past the initial error listed, but then I get a bunch of errors regarding missing methods in the various check files, and the errors are valid. For example, I get the error "Method invocation failed because [ORCA100] does not contain a method named 'op_Addition'". Looking in the "check-ORCA100.ps1" file it does not contain anything related to 'op_Addition"... Something is definitely missing.

[UPDATE: I GOT IT TO WORK!]

  1. Update the line of code ". $CheckFile.FullName" to ". $($CheckFile.FullName)"
  2. It seems Powershell has an issue with loading classes and so the ORCA commands must be run from Powershell ISE (new-object - cannot find type VNVDTrafficFilterPolicyConfig - verify assembly containing this type is loaded vNugglets/vNuggletsPSMod_vDNetworking#1)
  3. If you are using this script for a specific tenant type add the "-ExchangeEnvironmentName" switch to each connection string in the ORCA.psm1 code.

@NehavPandey
Copy link
Collaborator

Issue resolved as per last comment hence closing the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants