A CIM-ple PowerShell Challenge

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!


4 Replies to “A CIM-ple PowerShell Challenge”

Comments are closed.