Logo Danno Projects
  • Home
  • About
  • Skills
  • Experiences
  • Education
  • More
    Recent Posts Accomplishments
  • Posts
  • Dark Theme
    Light Theme Dark Theme System Theme
Logo Inverted Logo
  • Posts
  • DevOps
    • Ansible
    • Docker
      • Setting up Docker and Jenkins on a Raspberry Pi
      • WiFi Monitor System
    • Python
      • Replacing Excel with a SharePoint List for Inventory Management
      • Printer Monitor: Because Printers Are Out to Get Us
  • Power Platform
    • SMS Notification
    • Power Outage Notifications
    • PowerApps Bingo
    • PowerApps Barcode Reader
    • Button Permissions
    • Delegation
  • Projects
    • Sena 20S Evo Battery Replacement
  • PowerShell
    • New-TimeSpan
Hero Image
New-TimeSpan

I was investigating an issue with our identity provider and out of date passwords the other day. I needed to do a date comparison to find accounts with expired passwords. In the past I’d used (Get-Date).AddDays() and done an evaluation. It works, but to me the code is hard to read. I stumbled on the New-Timespan cmdlet which creates a timespan object. Creating a timespan object and referencing the days property is so much easier to read when you look at the code.

Thursday, March 24, 2022 | 1 minute Read
Navigation
  • About
  • Skills
  • Experiences
  • Education
  • Recent Posts
  • Accomplishments
Contact me:
  • dannoprojects 'at' gmail.com

Liability Notice: This theme is under MIT license. So, you can use it for non-commercial, commercial, or private uses. You can modify or distribute the theme without requiring any permission from the theme author. However, the theme author does not provide any warranty or takes any liability for any issue with the theme.


Toha Theme Logo Toha
© 2025 Copyright.
Powered by Hugo Logo