microsoft / Requirements

PowerShell framework for declaratively defining and idempotently imposing system configurations
MIT License
159 stars 26 forks source link

Namespace does not end up in output Requirements #64

Closed jrobiii closed 4 years ago

jrobiii commented 4 years ago

Using the following snippet from "Managing large configurations with Namespaces" produces Requirements without a Namespace (Namespace = "::" or ":"):

New-RequirementGroup "local" {
    New-RequirementGroup "clis" {
        @{
            Describe = "az is installed"
            Test     = { ... }
            Set      = { ... }
        }
        @{
            Describe = "kubectl is installed"
            Test     = { ... }
            Set      = { ... }
        }
    }
    New-RequirementGroup "configs" {
        @{
            Describe = "cluster config is built"
            Test     = { ... }
            Set      = { ... }
        }
    }
}
New-RequirementGroup "cloud" {
    @{
        Describe = "Terraform is deployed"
        Test     = { ... }
        Set      = { ... }
    }
}

This is the output:

DependsOn : {}
Namespace : ::
Describe  : az is installed
Test      :  ... 
Set       :  ... 

DependsOn : {}
Namespace : ::
Describe  : kubectl is installed
Test      :  ... 
Set       :  ... 

DependsOn : {}
Namespace : ::
Describe  : cluster config is built
Test      :  ... 
Set       :  ... 

DependsOn : {}
Namespace : :
Describe  : Terraform is deployed
Test      :  ... 
Set       :  ... 

Requirements version 2.3.5 Same results in Powershell 5.1 and 7.0 (preview)

Name                           Value
----                           -----
PSVersion                      5.1.17763.1007
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.1007
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
Name                           Value
----                           -----
PSVersion                      7.0.0-rc.3
PSEdition                      Core
GitCommitId                    7.0.0-rc.3
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
chriskuech commented 4 years ago

Fixed and added a regression test.

jrobiii commented 4 years ago

That worked like a champ. Thanks for the quick turnaround!