Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/evotecit/powershellmanager

Little PowerShell module to extract PowerShell scripts that no longer exists on disk but were run and are still in Event Logs.
https://github.com/evotecit/powershellmanager

hacktoberfest powershell restore scripts

Last synced: 4 days ago
JSON representation

Little PowerShell module to extract PowerShell scripts that no longer exists on disk but were run and are still in Event Logs.

Awesome Lists containing this project

README

        
















# PowerShellManager

Little PowerShell module to extract PowerShell scripts that no longer exists on disk but were run and are still in Event Logs. More information [available on blog post](https://evotec.xyz/restoring-recovering-powershell-scripts-from-event-logs/).

# Usage

Extracing PowerShell scripts from Windows PowerShell Event Log and saving it to ScriptsLocal directory in same folder.
Format makes sure the script is formatted and, and AddMarkdown adds additional information to asses where the script is coming from.

```powershell
Restore-PowerShellScript -Type WindowsPowerShell -Path $PSScriptRoot\ScriptsLocal -Verbose -Format -AddMarkdown
```

Same as above but with a difference that it scans remote servers (two of them). It does it in parallel.

```powershell
# Keep in mind AD1/AD2 will do it in parallel
Restore-PowerShellScript -Type WindowsPowerShell -Path $PSScriptRoot\ScriptsRemote -ComputerName AD1, AD2 -Verbose -Format -AddMarkdown
```

## To install

Just install module from PowerShellGallery.

```powershell
Install-Module -Name PowerShellManager -AllowClobber -Force
```

Force and AllowClobber aren't necessary, but they do skip errors in case some appear.

## And to update

```powershell
Update-Module -Name PowerShellManager
```

That's it. Whenever there's a new version, you run the command, and you can enjoy it. Remember that you may need to close, reopen PowerShell session if you have already used module before updating it.

**The essential thing** is if something works for you on production, keep using it till you test the new version on a test computer. I do changes that may not be big, but big enough that auto-update may break your code. For example, small rename to a parameter and your code stops working! Be responsible!

## Changelog

- 0.1.2 - 2021.01.19
- Fix for reading from file system
- 0.1.1 - 2020.08.28
- Additional security (prevents from accidental execution)
- First release