Quantcast
Channel: SharePoint 2013 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 26374

Help with PowerShell and SP Script

$
0
0

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?!


Viewing all articles
Browse latest Browse all 26374

Trending Articles