Guest User

Untitled

a guest
Dec 13th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. $command = '"C:Program FilesTheProgRunit.exe" Hello';
  2.  
  3. $command = 'echo "hello world!"';
  4.  
  5. $command = "echo `"it`'s`"";
  6.  
  7. iex $command
  8.  
  9. $command = 'C:somepathsomeexe.exe somearg'
  10. iex $command
  11.  
  12. >> &"C:Program FilesSome ProductSomeExe.exe" "C:some other pathfile.ext"
  13.  
  14. $command = '"C:Program FilesSome ProductSomeExe.exe" "C:some other pathfile.ext"'
  15. iex "& $command"
  16.  
  17. function myeval($command) {
  18. if ($command[0] -eq '"') { iex "& $command" }
  19. else { iex $command }
  20. }
  21.  
  22. MSBuild /t:Publish --% /p:TargetDatabaseName="MyDatabase";TargetConnectionString="Data Source=.;Integrated Security=True" /p:SqlPublishProfilePath="Deploy.publish.xml" Database.sqlproj
  23.  
  24. $path = 'HKLM:SOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall'
  25. $app = 'MyApp'
  26. $apps= @{}
  27. Get-ChildItem $path |
  28. Where-Object -FilterScript {$_.getvalue('DisplayName') -like $app} |
  29. ForEach-Object -process {$apps.Set_Item(
  30. $_.getvalue('UninstallString'),
  31. $_.getvalue('DisplayName'))
  32. }
  33.  
  34. foreach ($uninstall_string in $apps.GetEnumerator()) {
  35. $uninstall_app, $uninstall_arg = $uninstall_string.name.split(' ')
  36. & $uninstall_app $uninstall_arg
  37. }
Add Comment
Please, Sign In to add comment