lundi 6 avril 2020

C# if powershell script end show message

If the script finished I want a messagebox popup, but I don't know the if statement.

    using (PowerShell PowerShellInstance = PowerShell.Create())
    {
        PowerShellInstance.AddScript("cmdkey /list | ForEach-Object{if($_ -like \"*Target:*\"){cmdkey /del:($_ -replace \" \",\"\" -replace \"Target:\",\"\")}}");
        PowerShellInstance.Invoke();
        if ()
        {
            MessageBox.Show("the process was successfully completed");
        }

Aucun commentaire:

Enregistrer un commentaire