This file contains 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
Install-Module PSRAW -Scope CurrentUser | |
Import-Module PSRAW | |
# Go here https://ssl.reddit.com/prefs/apps | |
# use https://127.0.0.1 for redirect uri | |
# register Script App and note client id and secret | |
Connect-Reddit | |
$Params = @{ |
This file contains 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
const express = require('express') | |
const app = express() | |
app.get('/api', function (req, res) | |
{ | |
res.send('0') | |
}) | |
app.listen(5001, function () | |
{ |
This file contains 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
$File = (Get-Content .\.spelling) | |
$Head = $File[0..4] | |
$Count = 0 | |
$Dictionary = foreach($Line in $File[5..($File.Count -1)]){ | |
$Count ++ | |
if($Line -Match '^#region ' -or [string]::IsNullOrEmpty($line)){continue} | |
if($line -match '^ -|^#endregion'){break} | |
$line | |
} | |
$Dictionary = $Dictionary | Sort-Object |
This file contains 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
class MockedWebResponseAsyncResult : System.IAsyncResult { | |
[System.Net.WebRequest] $Request; | |
[Object]$state | |
MockedWebResponseAsyncResult([System.Net.WebRequest] $request, [object]$State) { | |
$this.Request = $request | |
$This.State = $State | |
} | |
[bool] get_IsCompleted () { |
This file contains 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
#Requires -Modules PoshRSJob, ActiveDirectory | |
# create this file as read-Only before running script | |
$SourceFile = "C:\perfc" | |
$ServerFilter = {enabled -eq $True -and DnsHostName -like "*" -and operatingSystem -like "*windows*"} | |
$SearchBase = "dc=adatum,dc=com" | |
$LogFile = "C:\NotPetyaPatch.xml" | |
$Throttle = 40 |
This file contains 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
$OS = (Get-WMIObject Win32_OperatingSystem).Caption | |
$DaysToDelete = 30 | |
if(($OS -like "*2008*") -or ($OS -like "*2012*")){ | |
$diskbefore = GWMI -Class win32_LogicalDisk -Filter "DeviceID = 'C:'" | Select-Object @{ n = "$OS"; e = {$_.PSComputerName}}, @{ n = "FreeSpace(GB) Before" ; e = {"{0:N1}" -f( $_.Freespace / 1gb ) } }, @{ n = "PercentFree Before" ; e = {"{0:P1}" -f( $_.FreeSpace / $_.Size ) } } | Out-String | |
Write-Output "$diskbefore" | |
} | |
else{ | |
write-host @" |
NewerOlder