Author: Mike F Robbins
Mike F Robbins is a Microsoft MVP on Windows PowerShell and a SAPIEN Technologies MVP. He is a co-author of Windows PowerShell TFM 4th Edition and is a contributing author of a chapter in the PowerShell Deep Dives book. Mike has written guest blog articles for the Hey, Scripting Guy! Blog, PowerShell Magazine, and PowerShell.org. He is the winner of the advanced category in the 2013 PowerShell Scripting Games. Mike is also the leader and co-founder of the Mississippi PowerShell User Group. He blogs at mikefrobbins.com and can be found on twitter @mikefrobbins.
1 2 3 | $File = 'U:\GitHub\PowerShell\MrToolkit\Public\Find-MrModuleUpdate.ps1' $AST = [System.Management.Automation.Language.Parser]::ParseFile($File, [ref]$null, [ref]$null) $AST.ScriptRequirements.RequiredModules.Name |
1 2 3 | Get-AppxPackage | Where-Object -Property IsFramework -eq 'False' | Select-Object -Property Name, SignatureKind, IsFramework |
1 | $Process = 'notepad.exe'; Start-Process $Process -PassThru -OutVariable NoteProc; Stop-Process -Id $NoteProc.Id -Force |
There's never been a better time to purchase my PowerShell 101: The No-Nonsense Beginner’s Guide to PowerShell eBook. It's currently on sale for $4.99 using this link which automatically includes a coupon code that's good from now until the end of the year or for the first 50 redemptions, whichever comes first. Not sure whether or not this book is for you? Download the free sample which includes the first two chapters.
About the Book
Before PowerShell, I spent the first third of my career Read more [...]
You need to have an Active Directory domain in place. I'm picking up where I left off in my previous blog article "Use PowerShell to Create a New Active Directory Forest on Windows 2019 Server Core Installation (no-GUI)".
The procedure shown in this blog article is for demonstration purposes only.
Install the DHCP server feature.
1 | Install-WindowsFeature -Name DHCP |
Add the DHCP scope to the server.
1 | Add-DhcpServerv4Scope -Name '192.168.129.x' -StartRange 192.168.129.101 -EndRange 192.168.129.199 -SubnetMask 255.255.255.0 |
Options can either be set at the scope level.
1 | Set-DhcpServerv4OptionValue -ScopeID '192.168.129.0' -DNSServer 192.168.129.100 -DNSDomain mikefrobbins.com -Router 192.168.129.1 |
You have a fresh installation of Windows Server 2019 that was installed using the default installation type of server core installation (no-GUI). This server will be the first domain controller in a brand new Active Directory forest. You've completed the following configuration prior to attempting to turn this server into a domain controller:
Install all the available Windows Updates
Set the time zone
Set the computer name
Set a static IP address
Log into the server and launch PowerShell Read more [...]
You've probably heard, as I have, that Visual Studio Code (VSCode) is the latest whiz-bang editor that you should be using for PowerShell (and I am for development of PowerShell code on my primary workstation). One word of caution though is to make sure to put things into perspective and not be so quick to shun people away from using the PowerShell Integrated Scripting Environment (ISE), depending on how they're using it.
I recently received a comment about my choice of editors for a particular Read more [...]
Windows 10 version 1709 introduced a default Hyper-V virtual switch which is installed when the Hyper-V role is added. As you can see in the following example, by default on Windows 10, the default virtual switch does not exist because the Hyper-V role hasn't been added.
1 | Get-NetAdapter |
Now that the Hyper-V role has been added, you can see that a new network adapter named "vEthernet (Default Switch)" exists.
1 | Get-NetAdapter | Format-Table -AutoSize |
While you wouldn't think this Read more [...]
As I previously mentioned a little over a month ago in my blog article "PowerShell Script Module Design Philosophy", I'm transitioning my module build process to a non-monolithic design in development and a monolithic design for production to take advantage of the best of both worlds. Be sure to read the previously referenced blog article for more details on the subject.
My goal is to write a reusable tool to retrieve the necessary information from a non-monolithic script module that's necessary Read more [...]
This blog article is the third in a series of learning about the PowerShell Abstract Syntax Tree (AST). Be sure to read the other two if you haven't already.
Learning about the PowerShell Abstract Syntax Tree (AST)
Learn about the PowerShell Abstract Syntax Tree (AST) – Part 2
Learn about the PowerShell Abstract Syntax Tree (AST) – Part 3
In this blog article, I'll be specifically focusing on finding the AST recursively.
I'll start off by storing the path to one of my functions Read more [...]