Run Selection in Powershell studio

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Post Reply
Posts: 1
Joined: Mon Aug 31, 2020 7:32 am

Run Selection in Powershell studio

Post by paulkantor »


I am fairly new to powershell scripting. With that said, I have a script that creates a CNAME record in dns. The script runs fine when clicking the 'Run' button in Powershell Studio 2020. I added this script to a larger config script, and now the script fails. After doing some troubleshooting, I found that this section runs fine in PS 2020 if I highlight the create CNAME code and right click "Run Selection", but fails if I select "Run Selection in Console.
Any Idea what I am doing wrong?

Any guidance would be appreciated!

Posts: 14543
Joined: Tue May 22, 2007 9:57 am

Re: Run Selection in Powershell studio

Post by jvierra »

There is absolutely no way to answer your question. I can on,.y recommend running this in debug mode and stepping through your code to see what is happening.

I can also recommend starting with the following free book which will help you understand how PowerShell code works and how to run and debug PowerShell code. ... werShell-4

Good luck and post back when you have more information.

Post Reply