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 @" |
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
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
$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
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
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
.\commands\utility\WebCmdlet\StreamHelper.cs(279,27): error SA1204: Static members should appear before non-static members | |
.\commands\utility\WebCmdlet\FormObject.cs(40,16): error SA1201: A constructor should not follow a property | |
.\commands\utility\WebCmdlet\FormObject.cs(17,23): error SA1609: Property documentation should have value | |
.\commands\utility\WebCmdlet\FormObject.cs(22,23): error SA1609: Property documentation should have value | |
.\commands\utility\WebCmdlet\FormObject.cs(27,23): error SA1609: Property documentation should have value | |
.\commands\utility\WebCmdlet\FormObject.cs(32,43): error SA1609: Property documentation should have value | |
.\commands\utility\WebCmdlet\FormObjectCollection.cs(19,13): error SA1616: Element return value documentation should have text | |
.\commands\utility\WebCmdlet\FormObjectCollection.cs(18,13): error SA1614: Element parameter documentation should have text | |
.\commands\utility\WebCmdlet\Common\BasicHtmlWebResponseObject.Common.cs(5,1): error SA1200: Using directive should ap |
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
using System; | |
namespace Lambda | |
{ | |
public class CodeCommitEventCodecommitReference | |
{ | |
public string commit; | |
public bool created = false; | |
public string @ref; |
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
function ConvertTo-Base64KMSEncryptedString { | |
[CmdletBinding()] | |
param ( | |
[Parameter( | |
Mandatory = $true, | |
ValueFromPipeline = $true | |
)] | |
[String[]] | |
$String, |
OlderNewer