I am trying to get a script working, and part of it involves setting up secure store. This actually works ok, but one of my goals is to get it to look if a Secure Store Target Application with a certain name, already exists, so rather than error and look all untidy, it says a nice message. Here is the snippet I have;
WriteLine
$Check = Get-SPSecureStoreApplication -ServiceContext $WebAppURL -Name "TargetServiceApp"
If ($Check)
{
Write-Host " - Target Application already installed..."
}
After else is the rest of the script - so not important. BUT, my issue is somewhere with my $Check..... It does seem to check and aknowledge it exists, and works ok - BUT, the script show the error in bright red font as well as " - Target Application already installed..."
Any ideas how I can get just " - Target Application already installed..." to show?!