I am learning PowerShell and have written my first script, a twenty line, one page script (after reading through Ed Wilson's First Steps, Step-by-Step, and then the Deep Dives book). Surprisingly, no line of my script executes, yet no error message appears and the $Error variable is empty. Following the best practices suggested in "Deep Dives" the script was created by the ISE Editor's Snippets "Cmdlet (Advanced function)" template.
Placing the cursor on each curly brace shows its matching brace exists and is in the correct place. The comment lines are highlighted in Green by the ISE Editor, so I can see that I have not inadvertently commented out my entire script :)
Placing a Write-Host cmdlet in the Begin and End Blocks produced no pop-up window. Setting a Breakpoint on the first executable line of the script failed to pause the code at that line (though the line was highlighted in brown by the ISE editor). Opening the ISE console in Administrator mode had no effect. Issuing Set-PSDebug -Step merely asked permission (Yes/No) to execute the script then completed without pause. Listing the Script Execution Policy showed "RemoteSigned" for LocalMachine and Undefined for all other scopes on my Windows 8.1 computer. Setting the policy scope for CurrentUser to "RemoteSigned" was successful but did not cause the script's code to execute.
What step am I missing to cause the code within my script to execute?
Jeffrey - New Orleans MCITP Enterprise Administrator, Virtualization Administrator