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

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -