vmware / powershell-module-for-vmware-cloud-foundation-password-management

PowerShell Module for VMware Cloud Foundation Password Management
https://vmware.github.io/powershell-module-for-vmware-cloud-foundation-password-management/
BSD 2-Clause "Simplified" License
11 stars 9 forks source link

`Invoke-PasswordPolicyManager` output json depth limited #68

Closed nzRegularIT closed 1 year ago

nzRegularIT commented 1 year ago

Code of Conduct

VMware Cloud Foundation

4.5.0

PowerShell Version

Windows PowerShell 5.1

PowerCLI Version

13.1.0.21624340

Module Version

1.2.0.1005

PowerValidatedSolutions Version

2.4.0.1008

PowerVCF Version

2.3.0.1004

Guest Operating System

Windows Server 2019

Environment Details

No response

Description

json output for Invoke-PasswordPolicyManager is truncated past depth 2

Error or Debug Output

The default depth for ConvertTo-Json is 2

Expected Behavior

{
    "vcf": {
        "vcfVersion": "4.5.0"
    },
    "sddcManager": {
        "passwordExpiration": [
            {
                "Workload Domain": "test-m1c1",
                "System": "test-vcf",
                "User": "root",
                "Min Days": "0",
                "Max Days": "365",
                "Warning Days": "7"
            },
            {
                "Workload Domain": "test-m1c1",
                "System": "test-vcf",
                "User": "vcf",
                "Min Days": "0",
                "Max Days": "365",
                "Warning Days": "7"
            },
            {
                "Workload Domain": "test-m1c1",
                "System": "test-vcf",
                "User": "backup",
                "Min Days": "0",
                "Max Days": "365",
                "Warning Days": "7"
            }
        ],
        "passwortestplexity": {
            "System": "test-vcf",
            "Min Length": "16",
            "Min Lowercase": "-1",
            "Min Uppercase": "-1",
            "Min Numerical": "-1",
            "Min Special": "-1",
            "Min Unique": "4",
            "Min Classes": "4",
            "Max Sequence": "0",
            "History": "5",
            "Max Retries": "3"
        },
        "accountLockout": {
            "System": "test-vcf",
            "Max Failures": "3",
            "Unlock Interval (sec)": "300",
            "Root Unlock Interval (sec)": "300"
        }
    }
}

Actual Behavior

{
    "vcf": {
        "vcfVersion": "4.5.0"
    },
    "sddcManager": {
        "passwordExpiration": [
            "@{Workload Domain=test-m1c1; System=test-vcf; User=root; Min Days=0; Max Days=365; Warning Days=7}",
            "@{Workload Domain=test-m1c1; System=test-vcf; User=vcf; Min Days=0; Max Days=365; Warning Days=7}",
            "@{Workload Domain=test-m1c1; System=test-vcf; User=backup; Min Days=0; Max Days=365; Warning Days=7}"
        ],
        "passwortestplexity": {
            "System": "test-vcf",
            "Min Length": "8",
            "Min Lowercase": "-1",
            "Min Uppercase": "-1",
            "Min Numerical": "-1",
            "Min Special": "-1",
            "Min Unique": "4",
            "Min Classes": "4",
            "Max Sequence": "0",
            "History": "0",
            "Max Retries": "3"
        },
        "accountLockout": {
            "System": "test-vcf",
            "Max Failures": "3",
            "Unlock Interval (sec)": "86400",
            "Root Unlock Interval (sec)": "300"
        }
    }
}

Steps to Reproduce

Run

Invoke-PasswordPolicyManager `
    -sddcManagerFqdn $sddcFqdn `
    -sddcManagerUser $sddcUser `
    -sddcManagerPass $sddcPass `
    -sddcRootPass $sddcRootPw `
    -allDomains `
    -reportPath "C:\VcfPwPolicy" `
    -json

Log Fragments and Files

No response

Screenshots

No response

References

Workaround

Replace

ConvertTo-Json | Out-File -FilePath $jsonFile

With

ConvertTo-Json -Depth 25 | Out-File -FilePath $jsonFile
nzRegularIT commented 1 year ago

Legends!!! Thanks team :)

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.