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
# Get a list of posts from reddit.com/r/sysadmin front page | |
$posts = Invoke-RestMethod 'https://www.reddit.com/r/sysadmin/.json' | |
# Get the URL for the patch tuesday megathread | |
$megathread = $posts.data.children.data.Where{$_.title -like '*Patch Tuesday Megathread*'} | |
$megathreadUrl = $megathread.Url | |
# Get the comments of the megathread | |
$comments = Invoke-RestMethod "$megathreadUrl.json" |
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
# Set the Google Auth parameters. Fill in your RefreshToken, ClientID, and ClientSecret | |
$params = @{ | |
Uri = 'https://accounts.google.com/o/oauth2/token' | |
Body = @( | |
"refresh_token=$RefreshToken", # Replace $RefreshToken with your refresh token | |
"client_id=$ClientID", # Replace $ClientID with your client ID | |
"client_secret=$ClientSecret", # Replace $ClientSecret with your client secret | |
"grant_type=refresh_token" | |
) -join '&' | |
Method = 'Post' |
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
<# | |
.Synopsis | |
Edit nessus scan details, including schedule, name, and policy data | |
.DESCRIPTION | |
Long description | |
.EXAMPLE | |
Example of how to use this cmdlet | |
.EXAMPLE | |
Another example of how to use this cmdlet | |
#> |
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
<# | |
.SYNOPSIS | |
Schedule Nessus scans based around the Microsoft patch cycle | |
#> | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$true)][String]$ComputerName, | |
[Int]$Port = 8834, | |
[Parameter(Mandatory=$true)][String]$ScanFolder, |
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
<# | |
This is a fairly simple one-time upload with no options, etc. Consider using this as a base to create a New-GDriveItem type function | |
Modified code, in response to: https://monteledwards.com/2017/03/05/powershell-oauth-downloadinguploading-to-google-drive-via-drive-api/ | |
You should follow the above link to set $accessToken to your access token and understand what is happening here | |
#> | |
# Change this to the file you want to upload | |
$SourceFile = 'C:\Path\To\File' | |
# Get the source file contents and details, encode in base64 |
NewerOlder