Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Guidance for writing a Connect- Cmdlet

$
0
0

Hi gang,

I'm considering writing a collection of PowerShell Cmdlets to manage instances of an online service, and since they all require an instance URL and a Token for authentication, I thought it'd make sense to have a "Connect-" Cmdlet that you run first (similar to "Connect-AzureAD" etc).

Is there any official guidance out there on how to write these "Connect-" Cmdlets? Like if I were to invoke my hypothetical Cmdlet like this:

>Connect-Whatever -Url $url -Credential $creds

... how do I persist the information so that subsequent "-Whatever" Cmdlets can access it? What exactly does a "Connect-" Cmdlet do?

Thanks,
Matt


Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>