Powershell script - Organize script by functions -
when put function {}
around powershell script, change registry key, script doesn't seem run within brackets. when take out function {}, script runs fine. missing here?
function clearpagefile { $regpath = "hklm:\system....(rest of path)" $key = "clearpagefileatshutdown set-itemproperty -path $regpath -name $key -value 0 }
unless calling function place else, here's answer...
function clearpagefile { $regpath = "hklm:\system....(rest of path)" $key = "clearpagefileatshutdown set-itemproperty -path $regpath -name $key -value 0 } #call function clearpagefile
Comments
Post a Comment