Advertisement
Guest User

Untitled

a guest
May 5th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. function ShuttingDown {
  2. [string]$sourceCode = @"
  3. using System;
  4. using System.Runtime.InteropServices;
  5.  
  6. namespace Vagrant {
  7. public static class RemoteManager {
  8. private const int SM_SHUTTINGDOWN = 0x2000;
  9.  
  10. [DllImport("User32.dll", CharSet = CharSet.Unicode)]
  11. private static extern int GetSystemMetrics(int Index);
  12.  
  13. public static bool Shutdown() {
  14. return (0 != GetSystemMetrics(SM_SHUTTINGDOWN));
  15. }
  16. }
  17. }
  18. "@
  19. $type = Add-Type -TypeDefinition $sourceCode -PassThru
  20. return $type::Shutdown()
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement