Table of Contents

Start-CafScoped

Executes a command or script file in a new powershell session which is authenticated with a service principal.

Syntax

Start-CafScoped
    [-Command <string>]
    [-ServicePrincipalScope <string>]
    [-ServicePrincipalType <string>]
    [-FileCommand]

Description

Executes the command obtained from the parameter in a specific scope. This keeps the user scope intact even after performing a task which might have altered the scope otherwise.

Example

Start-CafScoped
    -Command "./yourScript.ps1"
    -FileCommand

Parameter

-Command
Specify the powershell command you want to execute.

Property Value
Type: string
Default value: None
Required: False

-ServicePrincipalScope Specifies the scope of service principal to use.

Property Value
Type: string
Allowed values: ["Subscription", "ManagementGroup"]
Default value: "Subscription"
Required: False

-ServicePrincipalType Specifies the type of service principal to use.

Property Value
Type: string
Allowed values: ["deploy", "ops"]
Default value: "deploy"
Required: False

-FileCommand
Let's the cmdlet know that you want to execute a command from a file.

Property Value
Type: SwitchParameter
Default value: False
Required: False