aldrichtr / infraspective

Infrastructure testing using pester
MIT License
18 stars 0 forks source link

Update project documents for users and contributors #102

Open aldrichtr opened 1 year ago

raandree commented 1 year ago

I have tried it but failed.

  1. Can you add a note why creating a local repo is required, please? I tried finding a way to install a nuget file but failed, so the way you have chosen makes total sense.
  2. Installing the modules does not work. I got the error
Install-Module : The RequiredVersion, MinimumVersion, MaximumVersion, AllVersions or AllowPrerelease parameters are allowed only when you specify a single name as the 
value of the Name parameter, without any wildcard characters.

This way it works:

$modulesToInstall = 'Pester', 'Configuration', 'Logging', 'EPS', 'Pansies'
foreach ($moduleToInstall in $modulesToInstall) {
    Install-Module -Name $moduleToInstall -AllowClobber -AllowPrerelease
}
  1. Importing the newly installed module (Import-Module -Name infraspective) throws errors
At C:\Program Files\WindowsPowerShell\Modules\infraspective\0.4.1\infraspective.psm1:87 char:28
+         $name = $Tree.Name ? $Tree.Name : "none"
+                            ~
Unexpected token '?' in expression or statement.
At C:\Program Files\WindowsPowerShell\Modules\infraspective\0.4.1\infraspective.psm1:88 char:30
+         $title = $Tree.Title ? $Tree.Title : "none"
+                              ~
Unexpected token '?' in expression or statement.
At C:\Program Files\WindowsPowerShell\Modules\infraspective\0.4.1\infraspective.psm1:156 char:52
+         $config_level = $log_level[$config.$Scope] ?? $log_level.INFO
+                                                    ~~
Unexpected token '??' in expression or statement.
At C:\Program Files\WindowsPowerShell\Modules\infraspective\0.4.1\infraspective.psm1:240 char:38
+         if (-not($map."$Type".Render ?? $map.Default.Render)) {
+                                      ~~
Unexpected token '??' in expression or statement.
At C:\Program Files\WindowsPowerShell\Modules\infraspective\0.4.1\infraspective.psm1:240 char:37
+         if (-not($map."$Type".Render ?? $map.Default.Render)) {
+                                     ~
Missing closing ')' in expression.
At C:\Program Files\WindowsPowerShell\Modules\infraspective\0.4.1\infraspective.psm1:240 char:38
+         if (-not($map."$Type".Render ?? $map.Default.Render)) {
+                                      ~~
Missing closing ')' after expression in 'if' statement.
At C:\Program Files\WindowsPowerShell\Modules\infraspective\0.4.1\infraspective.psm1:212 char:13
+     process {
+             ~
Missing closing '}' in statement block or type definition.
At C:\Program Files\WindowsPowerShell\Modules\infraspective\0.4.1\infraspective.psm1:178 char:23
+ function Write-Result {
+                       ~
Missing closing '}' in statement block or type definition.
At C:\Program Files\WindowsPowerShell\Modules\infraspective\0.4.1\infraspective.psm1:240 char:60
+         if (-not($map."$Type".Render ?? $map.Default.Render)) {
+                                                            ~
Unexpected token ')' in expression or statement.
At C:\Program Files\WindowsPowerShell\Modules\infraspective\0.4.1\infraspective.psm1:240 char:61
+         if (-not($map."$Type".Render ?? $map.Default.Render)) {
+                                                             ~
Unexpected token ')' in expression or statement.
Not all parse errors were reported.  Correct the reported errors and try again.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

ipmo : The module to process 'infraspective.psm1', listed in field 'ModuleToProcess/RootModule' of module manifest 'C:\Program 
Files\WindowsPowerShell\Modules\infraspective\0.4.1\infraspective.psd1' was not processed because no valid module was found in any module directory.
At line:1 char:1
+ ipmo infraspective
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (infraspective:String) [Import-Module], PSInvalidOperationException
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

What am I missing?

aldrichtr commented 1 year ago

Hi @raandree ... I'm sorry you are having issues!

It looks like those errors are because of the ternary operator and null coalescing

Can you tell me what version of powershell you are running?

aldrichtr commented 1 year ago

@raandree: All of this definitely highlights the need for me to publish to the gallery. I know that updates to this project have been slow recently, but I am finishing up the other projects and will have time to get back to this. I will be refining the docs and publishing the next version on the gallery so that it is easier to use. My apologies, but I really appreciate you taking the time to try this out!!