I wrote a powershell module in c# which allows me to call some webservices. Before I can use them, I have to specify where the service is located. For example:
Set-ServiceUrl 'http://myService.cloudapp.net/'
Create-Something ...
Get-Something ...
The test functions Create-Something and Get-Something accessing a static variable "serviceurl" which is set within the Set-ServiceUrl function.
This is similar to the Azure module where you have to call Set-AzureSubscription before you can query the services.
The diffrent between my and the Azure module is, that I have to specifiy the service url for my module for each time I start the powershell whereas I have to set the AzureSubscription only once.
Is there any mechanism in powershell to store such information "forever"? Or do I have to use a file-based / registry or environment-variable solution? What would you suggest?