# encoding: ascii
# api: powershell
# title: Lock-WorkStation
# description: Locks the workstation’s display. Locking a workstation protects it from unauthorized use.
# version: 0.1
# type: function
# author: Mike Pfeiffer
# license: CC0
# function: Lock-WorkStation
# x-poshcode-id: 1640
# x-archived: 2017-04-30T09:54:24
# x-published: 2010-02-16T07:30:00
#
#
Function Lock-WorkStation {
$signature = @"
[DllImport("user32.dll", SetLastError = true)]
public static extern bool LockWorkStation();
"@

$LockWorkStation = Add-Type -memberDefinition $signature -name "Win32LockWorkStation" -namespace Win32Functions -passthru
$LockWorkStation::LockWorkStation() | Out-Null
}
