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

Clatent

Technology | Fitness | Food

  • About
  • Resources
  • Contact

PowerShell

Module Monday December 5, 2022

December 5, 2022 by ClaytonT Leave a Comment

I came across this module over the weekend, and have to say it’s a great little module. I’ve posted other modules that can do parts are of this, but this is great for quick checks and one offs. To name a few it grabs info for computer & operating system info, hardware devices with errors, hardware devices which are absent, and fixed storage volume details.

It can also install missing updates, update your PowerShell help, clear your recycling bin, delete temp files, and install/update sysinternals.

Definitely a great module to have in your toolbox.

PowerShell Gallery:
PSWinVitals/0.6.8

GitHub:
PSWinVitals

Tagged With: Module Monday, PowerShell

Read-Only Friday December 2, 2022

December 2, 2022 by ClaytonT Leave a Comment

Last month of the year… a good time to start reviewing how this year went for you. If you haven’t been keeping track take some time today and over this month to write down your accomplishment(you’ll be surprised how many), learning moments, and ways you want to improve in 2023. It doesn’t need to be formal, you just need to write it down so that you can reference it.

I know it may feel  like a busy task, but really do it. You may find some patterns that you do and don’t like, and see how you can change them in 2023. Also make sure to put any thing you want to learn in 2023 to keep you honest, or if you want to start becoming a speaker at events, look for upcoming events and write them down. Is there a certification you want? What do you need to do to make it happen? Create a schedule and put checkpoints in it to make sure you are on task.

Hope this gets you thinking more about this past year and how you will improve yourself in 2023. I’ll be posting more on this topic throughout the month help you with this process. Feel free to message me if you have any questions on the topic as well, always love to help out!

Tagged With: Development, Read-Only Friday

One-Liner Wednesday November 30, 2022

November 30, 2022 by ClaytonT Leave a Comment

It’s already Wednesday, can you believe it? Nothing crazy initially from today’s one liner, but once you learn the concepts, your imagination is the limit.

# Local Computer

(gcim Win32_OperatingSystem).LastBootUpTime

# Remote Computer

$s = new-cimsession -computername comp1,comp2 -credential credential

(gcim Win32_OperatingSystem -CimSession $s).LastBootTime

**GCIM is an alias for Get-CimInstance

So what does all of this mean? The first script will give you the last time your local computer booted up, and the second one does it for a remote computer. This is a great one liner(technically 2 for the remote as you need to create the CimSession) for you or your support team to make sure the user has really restarted their computer. Also a great way to check if a script you have that is supposed to reboot the device actually reboots it, and to not go any farther until the reboot has actually happened. I’d recommend having this one liner in your toolbox as well as creating a function out of it so that you can put parameter’s in place to make it even easier for your support team to use.

You also can see that I created a CimSession for the remote computer(s). This makes connecting to remote computers much easier and allow you to scale when needing information from CIM commands.

There is just so much information that you can get from the CimInstances and CimClass, that I can’t put here, but if you are looking for any thing related to hardware to a device check out these out. You can even see how much battery charge is left in a computer.

Get-CimInstance:
Microsoft Learn

Get-CimSession:
Microsoft Learn

CIM Classes:
Microsoft Learn

Tagged With: Cim, One Liner Wednesday, PowerShell, Remote

Module Monday November 28, 2022

November 28, 2022 by ClaytonT Leave a Comment

Hope all of my US friends had a good holiday! Now it’s Monday and we are back for another Module Monday. This is an important one, as it Is currently replacing a couple other modules as they are being depreciated. The 2 that are being depreciated are AzureAD and MSOnline if you didn’t know already. I’d check your scripts if you are still using them and convert them sooner than later.

So what is replacing these 2 modules? MS Graph, which doesn’t completely replace all the functionality as easily as we would like, but Microsoft is adding more features to it. This is how you will get license counts, Azure AD information, Teams, Exchange, Outlook, and any other 365 applications.

Also a great thing with Microsoft Graph is that it is cross-platform on PowerShell 7 and above so it doesn’t matter if you are using macOS, Linux, or Windows. You can still use it on Windows PowerShell 5.1 too.

PowerShell Gallery:

https://www.powershellgallery.com/packages/Microsoft.Graph/1.17.0

Microsoft Documentation:

https://learn.microsoft.com/en-us/powershell/microsoftgraph/overview?view=graph-powershell-1.0

Tagged With: 365, Microsoft Graph, Module Monday, PowerShell

Read-Only Friday November 25, 2022

November 25, 2022 by ClaytonT Leave a Comment

I know a lot of US workers have off today, but still wanted to post something as I know there are still many working and others who may have a little extra free time for learning. For today’s ROF, it really is a module or should I say modules, but the solution from these modules could be so helpful, I didn’t want someone to miss it.

The creator is called AsBuiltReport, which they have designed As Built Reports for different software and systems which you can customize what you want to see on the report and what thresholds should be for pass/fail.

Another way I could see using this to do to monthly/weekly/daily checks on your systems, and see if anything has been changed, but not only that, for certain(or all) systems it automatically changes back to the standard settings that it should be.

GitHub:

https://github.com/AsBuiltReport

Tagged With: AD, Fortinet, Nutanix, PowerShell, Read-Only Friday, Reporting, VMWare, Windows Server

One-Liner Wednesday November 23, 2022

November 23, 2022 by ClaytonT Leave a Comment

As we are approaching the holiday season  at the end of the year, dates are very important. Everything from counting down the days to the new year to creating those end of the year reports.

With that said, how many times have you had to create a report for the previous month, but it’s  parameters are only StartDate and EndDate? Now, you have to remember how many days are in that month and consider if it’s a leap year or not. And sometimes the first of the month is on a weekend, Holiday, or a day you took PTO so you have to make sure your code doesn’t just go back 30 days as then it may or may not get the whole previous month.  And let’s say for reasons you can’t control,  you can’t have it as a scheduled task to always run on the first of the month?

This one liner(technically 2 one for StartDate and one for EndDate), is the solution you need. It will check which month your in, go to the previous month then find the first and last day of that month. That’s it!

$StartDate = (Get-Date -Day 1).AddMonths(-1).ToString("yyyy-MM-dd")

$EndDate = (Get-Date -Day 1).AddDays(-1).ToString("yyyy-MM-dd")

If you wanted the past 6 months you could change the -1 to -6 in Start Date. Now you don’t have to manually enter the month date range every time you need a report for the previous month. You could set this as the default parameter, but give yourself the option to change it if you need a different date range.

Documentation:

Get-Date:
Microsoft Learn

Tagged With: Get-Date, One Liner Wednesday, PowerShell, Reporting

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 14
  • Page 15
  • Page 16
  • Page 17
  • Page 18
  • Interim pages omitted …
  • Page 20
  • Go to Next Page »

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

  • Learning ValidateSet in PowerShell: Valid Values Only
  • Teams Chat and PowerShell – How to add value!
  • EntraFIDOFinder: New Web UI and Over 70 New Authenticators
  • January 19, 2026 Updates to EntraFIDOFinder
  • v0.0.20 EntraFIDOFinder is out

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
  • Uncategorized
  • Windows
  • WSUS

© 2026 Clatent