Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "pimctl", Short: "CLI to manage Azure PIM roles and assignments", Long: "A CLI tool to manage Azure Privileged Identity Management (PIM) roles and assignments", Version: fmt.Sprintf("%s (%s)", build.Version, build.Date), DisableAutoGenTag: true, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { command := getCommand(cmd.CommandPath()) switch { case slices.Contains([]string{"login", "account clear", "account show", "account token"}, command): return nil case strings.HasPrefix(command, "help"): return nil case strings.HasPrefix(command, "completion"): return nil case strings.HasPrefix(command, "group"): if !isLoggedInMSGraph(cmd.Context()) { return fmt.Errorf("not logged in, run 'login' to continue") } case strings.Contains(command, "role entra"): if !isLoggedInMSGraph(cmd.Context()) { return fmt.Errorf("not logged in, run 'login' to continue") } case strings.Contains(command, "role azure"): if !isLoggedInARM(cmd.Context()) { return fmt.Errorf("not logged in, run 'login' to continue") } default: return fmt.Errorf("unknown command: %s", command) } return nil }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.