Although I have added the SharePoint snapin, "Add-PsSnapin Microsoft.SharePoint.PowerShell", I still get errors when delete SPSecurityStoreService as below descripted.
BCS: Message: The term 'Remove–SPSecureStoreApplication' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Code section is as below:
$targetApplicationName = 'HRSST'
$serviceContextUrl = "http://mingle.cnblogs.com:8080" #SharePoint server admin center
$ssApp = Get-SPSecureStoreApplication –ServiceContext $defaultServiceContext –Name $targetApplicationName
Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
[System.Threading.Thread]::Sleep(10000)
if ($ssApp -ne $null)
{
Remove–SPSecureStoreApplication -Identity $ssApp -Confirm:$false
}