Function: Get Parameter Sets Names of a PowerShell Cmdlet

by Simon Sparks · 23 September 2026

To use this function add it to the class library file named OrchestratorService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: OrchestratorService.ts

Description: Orchestrator Function to Get Parameter Sets Names of a PowerShell Cmdlet

Function: getParameterSetsNames

public getParameterSetsNames(objPowerShellCmdlet: PowerShellCmdlet): string[] {

    // @ts-ignore
    let objInfo: any = objPowerShellCmdlet.getInfo();    //  Found in code but not in documentation.

    let arrParameterSet: any[] = objInfo.getParameters();

    let arrParameterSetName: string[] = arrParameterSet.map((objParameterSet: any): string => {
        return objParameterSet.getName();
    });

    return arrParameterSetName;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like