Here's a recap of what you may have missed in our webcast last Thursday where we talked about using Regular Expressions in PowerShell.
Last week on PDQ Live we went over some of the uses for RegEx and how it can help you clean up your data for easier use in scripts.
For some RegEx resources see below or check out part of the webcast by clicking here.
Using ‘-replace’ in PowerShell to modify a string.
Using Regex to standardize data for easier use in scripts.
Q&A Question 1: What's a good resource for troubleshooting PowerShell scripts and why all the things are broken with it?
Q&A Question 2: What are some of the best formatting practices when writing functions?
In the Powershell ISE you can right click select ‘Start Snippets’ and use the pre-built snippets. These will provide templates for common functions.
Q&A Question 3: Is there a way to run a PowerShell script and have the results emailed similar to report emailing?
Q&A Question 4: How would you get info from AD - Like getting their phone numbers?
You can use the Get-ADUser to pull pretty much any info you need from the user object. Make sure you specify the property you want using the -Property flag.
Q&A Question 5: I am uninstalling a program with PowerShell script and PDQ Deploy, but the PowerShell script hangs. Is there a way to end the PowerShell script and move on to the next step?
It really depends on why the script is hanging. A common issue is forgetting to add the silent parameters to the uninstall string, if this happens it will pop-up a window expecting you to interact with the uninstall window. If you have a specific issue feel free to hit up firstname.lastname@example.org.
Brook is 100% definitely a human and enjoys human activities such as sleeping, correctly solving captchas, and eating food for energy. He's been sentient a sysadmin for ten years.