# 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: 6037
# x-archived: 2016-05-17T13:40:51
# x-published: 2016-10-05T10:54: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
}