How To

From MPSWiki
Jump to: navigation, search

Lock The file using powershell

run powershell (not ISE!)

$fileName = "C:\Users\Public\Documents\FIELDPRO\PROJECTS\folder\Ovintiv Dan FIU 6H FED 8H.PRJ\1.fpx"
$file = [System.io.File]::Open($fileName, 'Open', 'Read', 'None')
Write-Host "Press any key to continue ..."
$null = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
$file.Close()