The Chairman has commissioned a new PowerShell scripting challenge targeted for advanced users. But as with all challenges, everyone is welcome to try their hand. The best way to improve your PowerShell skills is to push yourself out of your comfort zone.
For this challenge, you are tasked with creating a PowerShell solution that will achieve the following result:
- Using the CIM classes, list all files in a specified folder on the local computer.
In other words, create a CIM-based alternative to Get-ChildItem. The user of your tool should be able to specify a location, with a default to the current location. You can decide what file properties to display and how. Although, it would be nice if the output resembled a directory listing.
Bonus
For extra credit or to push yourself, see how many of these elements you can also address:
- Support a recursive listing
- Format the output as a standard directory listing similar to Get-ChildItem.
- Support listing a folder from a remote Windows computer and/or CIMSession
- Show hidden, compressed and encrypted files or folders in a different color.
The Chairman looks forward to seeing links to your work in the comments. Good Luck!
Hi! This is my first powershell challenge with you 😉
I hope I did well
https://github.com/ManuPerezSan/ironscripter/blob/main/CIM-ple-PowerShell-Challenge/Get-CIMFiles.ps1
My contribution
https://github.com/CosmosKey/CimFile
My super-cool awesome submission for a CIMple alternative to Get-ChildItem. Pretty fun. I thought about adding the remote computer option as well, but didn’t tackle the recursive bit in a way that seemed great for remote work.
https://github.com/rgroefer/IronScripter/tree/main/CimpleFile/CimFileInfo
Here’s my take on this challenge. https://jdhitsolutions.com/blog/powershell/7992/answering-the-cim-directory-challenge/