Using a directory array for a choice menu inside a function

Usage of [System.Management.Automation.Host.ChoiceDescription[]] and $host.ui.PromptForChoice() with an array of data for choices. Default behavior when using functions is that the return value is every output, so when you want to return a value, using Write-Host inside the function will mess the return value up. The scenario is I wanted the user to provide a name,… Read More »

Conditional Where Clause in Powershell

Switching between ‘match‘ and ‘eq‘ in a where clause, depending on a variable:


SPTrustedIdentityTokenIssuer URI invalid

This week a problem occured on our SharePoint environment due to human error, but with unexpected SharePoint behavior driving the cause and troubling the solution. Somehow it is possible to update the SPTrustedIdentityTokenIssuer property ProviderSignoutUri with an invalid value, and all subsequent repair actions will fail, as well as many SPTimerjobs. All give the same… Read More »

Saving passwords securely in Powershell

When dealing with passwords in unattended installations, the challenge is always if the password is securly stored. One way to deal with it is to use “Read-Host -AsSecureString” on the target server from within the script. But when dealing with a lot of passwords in 1 script, this will cause a lot of prompts. You… Read More »