This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| Generates random, complex passwords | |
| #> | |
| function Generate-Password($length) | |
| { | |
| $password = ""; | |
| # Removed similar characters: i, l, o, O, 0, 1, I | |
| $alphabet= "abcdefghjkmnpqstuvwxyz23456789ABCDEFGHJKMNPQRSTUVWXYZ!@#$%^&*()" | |
| $char = for ($i = 0; $i -lt $alphabet.length; $i++) { $alphabet[$i] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Execute-CommandWithRetry($Command, $CommandName) { | |
| $currentRetry = 0; | |
| $success = $false; | |
| do { | |
| try | |
| { | |
| & $Command; | |
| $success = $true; | |
| Log-Debug "Successfully executed [$CommandName] command. Number of entries: $currentRetry"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| Does an syntax check for well formed email address | |
| #> | |
| function Valid-EmailAddress($address) | |
| { | |
| try | |
| { | |
| $results = New-Object System.Net.Mail.MailAddress($address) | |
| return $true | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $message="YOUR_MESSAGE";$title="YOUR_TITLE";$token="YOUR_APP_TOKEN";$uri = "https://your_gotify_service/message?token=$($token)";$body = @{ message = "$($message)"; title = "$($title)"; priority = 3};Invoke-RestMethod -Uri $uri -Method Post -Body $body |