Through powershell I want to execute NWAdmin commands. I have written simple command as shown below.
$spWebURL = Read-Host "Enter Web Application URL:"
$spWebApp = Get-SPWebApplication $spWebURL
$NWAdminCommand = Read-Host "Enter NWAdmin Command to perform request action:"
foreach ($SPSite in $spWebApp.Sites)
foreach($SPWeb in $SPSite.AllWebs)
$NWAdminCommandTest=".\NWAdmin.exe -o $NWAdminCommand -url $SiteURL";
NWAdmin commands format is shown below.
NWAdmin.exe -o PurgeWorkflowData [-workflowName workflowName] [-state[All|Running|Completed|Cancelled|Error]] [-url teamsiteUrl [-listName listName]] [-deletedLists]
How to check if user enter PurgeWorkflowData as command, is NWAdmin commands required -url as parameters?