Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ShuttingDown {
- [string]$sourceCode = @"
- using System;
- using System.Runtime.InteropServices;
- namespace Vagrant {
- public static class RemoteManager {
- private const int SM_SHUTTINGDOWN = 0x2000;
- [DllImport("User32.dll", CharSet = CharSet.Unicode)]
- private static extern int GetSystemMetrics(int Index);
- public static bool Shutdown() {
- return (0 != GetSystemMetrics(SM_SHUTTINGDOWN));
- }
- }
- }
- "@
- $type = Add-Type -TypeDefinition $sourceCode -PassThru
- return $type::Shutdown()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement