• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Clatent

Technology | Fitness | Food

  • About
  • Resources
  • Contact

One-Liner Wednesday February 15, 2023

February 15, 2023 by ClaytonT Leave a Comment

I’m just going to cut to the chase on this one..

 copilot "How to filter ID column not being empty and if it isn't empty it starts with a number and the other column named sideindicator having a r in it using powershell and importexcel and both criteria must be true?"
╔═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║Q: How to filter ID column not being empty and if it isn't empty it starts with a number and the other column named sideindicator having a r in it using powershell and importexcel and both criteria must be true?  ║
║═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════║
║1: $data = Import-Excel -Path "C:\Path\To\File.xlsx"                                                                                                                                                                 ║
║2: $data | Where-Object {$_.ID -and $_.ID -match '^\d' -and $_.SideIndicator -eq 'r'}                                                                                                                                ║
╚═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝

How about that? Nice little RegEx in there too! Yes this does work, as I used it this morning for a real life solution.

Download Doug Finke’s PowerShellAI module, get your OpenAI API key, and start having some fun! And if for some reason you still haven’t downloaded his ImportExcel module get that too! And want to hear a little more about Doug, check him out on the PowerShell Podcast and find out how ImportExcel is created.

That’s enough for today, I don’t want to take away your time from playing with this!

PowerShell Gallery:
PowerShellAI

GitHub:
PowerShellAI

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to email a link to a friend (Opens in new window) Email
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Reddit (Opens in new window) Reddit

Like this:

Like Loading...

Related

Tagged With: AI, One Liner Wednesday, PowerShell

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recipe Rating




Primary Sidebar

Clayton Tyger

Tech enthusiast dad who has lost 100lbs and now sometimes has crazy running/biking ideas. Read More…

Find Me On

  • Email
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter

Recent Posts

  • EntraFIDOFinder: New Web UI and Over 70 New Authenticators
  • January 19, 2026 Updates to EntraFIDOFinder
  • v0.0.20 EntraFIDOFinder is out
  • EntraFIDOFinder Update
  • Did you know: SSPR/Password Reset Edition

Categories

  • 365
  • Active Directory
  • AI
  • AzureAD
  • BlueSky
  • Cim
  • Dashboards
  • Documentation
  • Entra
  • Get-WMI
  • Learning
  • Module Monday
  • Nutanix
  • One Liner Wednesday
  • Passwords
  • PDF
  • Planner
  • PowerShell
  • Read-Only Friday
  • Reporting
  • Security
  • Windows
  • WSUS

© 2026 Clatent

%d