bdukes / PowerShellModules

A collection of PowerShell modules
Apache License 2.0
44 stars 9 forks source link

Added new functions #14

Closed kevinholtkamp closed 2 years ago

kevinholtkamp commented 2 years ago

I added Get-RecycledItems, changed Restore-Item to use Get-RecycledItems to not have duplicate code. Added Invoke-Elevated which runs a given ScriptBlock in an elevated powershell. Added Read-ArrayInput to read any number of inputs from the user.

Also added proper commentary to all the above functions.

I made lots of small commits, so please squash when merging

bdukes commented 2 years ago

I've pushed the Invoke-Elevated change.

At the moment I'm not sure that the Read-ArrayInput function fits great within my Read-Choice module.

I haven't had a change to review the Recycle changes yet. Did you change the implementation of Restore-Item?

Thanks, I appreciate your contributions!

kevinholtkamp commented 2 years ago

Changes to the interface of Restore-Item:

I also moved some logic from Restore-Item into Get-RecycledItems and added new logic for passing -ComObject

You can take your time reviewing this, there are probably some optimizations you could do.

However I would like to know wether you want to add Read-ArrayInput now though, as I would add it to my own module for personal use if not.

bdukes commented 2 years ago

I think you can go ahead and add Read-ArrayInput to your own module, thanks!

bdukes commented 2 years ago

I've published version 1.5.0 of the Recycle module with Restore-RecycledItem and Get-RecycledItem cmdlets, thanks!

kevinholtkamp commented 2 years ago

Thank you!