Regex insert dash

Hello all, Just getting started learning regex. I gather for my issue I need to do a capture group to insert a dash. I’ve got a text file and I’ve got instances of numbers like this: 12345601 That need to be 123456-01 Here is what I’ve got so far: Get-Content ‘C:UsersAdminDesktop20181020.txt’ | Select-String -Pattern ‘dddddddd’ […]

Time to move to PowerShell Core?

Are you a Windows Administrator? Still using Windows PowerShell? Did you know that Microsoft has no plans to add new features to Windows PowerShell? PowerShell Core is the shell moving forward. Don’t worry, it runs side-by-side with Windows PowerShell too! Bruce Payette announced his Release Candidate of the WindowsCompatilibity module for PowerShell Core on Twitter […]

Need help importing ProxyAddresses based off UserPrincipalName

I’ve used this script to import ProxyAddresses via Set-ADuser based off SamAccountName, but I have a need to alter it to key off of UserPrincipalName instead. $admail=Import-CSV C:proxyaddresses.csv Foreach ($a in $admail) { Set-ADUser $a.SamAccountName -Clear proxyaddresses $a.proxyaddresses -split “;” | % {Set-ADUser $a.samaccountname -Add @{proxyaddresses=$_ +” “}}# } The data source also contains DisplayName, […]

Script to silently install setup files in a given directory

I’m working on a script that will run and install all the setup files in a given directory. This is what I got so far: https://github.com/JoshuaMelo/Powershell-Scripts/blob/master/AutoInstaller.ps1 I would appreciate any feedback. I’m starting to question whether this is a realistic idea though. A lot of setup files take different command line switches so it would […]

Get Full name from Username

I’m creating a Employee Termination script and it start by entering the username But from that I want to show a pop-up windows asking if they want to terminate this employee by full name, but for the life of me I cannot get it working ​ # Import Assemblies [void][reflection.assembly]::Load(“System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”) #Get UserName […]