Hello,
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!
powershell scripting.
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.
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.
Re: powershell scripting.
Hi Daniel
Your issues are4 all a result of lack of knowledge of the basics of PowerShell. This wilkl make everything including how to use PSS very difficult. I recommend starting with a simple book to get you started. The first four chapters of this free and excellent introductory book will get you on the right path. Also review the other items in teh Info Center and the video list as there is a very large amount of information designed to help noon-programmers get started with {PowerShell.
https://www.sapien.com/books_training/W ... werShell-4
Your question, as asked, does not have enough information to even begin to suggest an answer. The best suggestion I can make is to run the full script under the PSS debugger to see if your code is actually being called. Common misunderstandings of how code and PowerShell work lead to the situation you describe although the exact cause can be any of 100+ reasons.
Another thing to note is that you say the code fails without indicating what that means. How do you know it is failing?
Your issues are4 all a result of lack of knowledge of the basics of PowerShell. This wilkl make everything including how to use PSS very difficult. I recommend starting with a simple book to get you started. The first four chapters of this free and excellent introductory book will get you on the right path. Also review the other items in teh Info Center and the video list as there is a very large amount of information designed to help noon-programmers get started with {PowerShell.
https://www.sapien.com/books_training/W ... werShell-4
Your question, as asked, does not have enough information to even begin to suggest an answer. The best suggestion I can make is to run the full script under the PSS debugger to see if your code is actually being called. Common misunderstandings of how code and PowerShell work lead to the situation you describe although the exact cause can be any of 100+ reasons.
Another thing to note is that you say the code fails without indicating what that means. How do you know it is failing?