Skip to content

Instantly share code, notes, and snippets.

Adam Bertram adbertram

Block or report user

Report or block adbertram

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MCPMag-Parameterized-ARM-Template.json
{
"$schema": "http://schema.management.azure.com/schemas/2018-05-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"webAppName": {
"type": "string"
},
"sqlDbName": {
"type": "string"
}
View powershell tweetdeck search terms
Matching: powershell
Excluding: Sharepoint Obfuscation obfuscator Payload mimikittenz exploits blackhat cybersec pentest metasploit exploit exploitation #pentesting penetration attack attacks trojan obfuscation pen hijacking logitech malware phishing infosec virus ransomware powerops offensive bsides reverse empire mimikatz
View Save-ConsoleOutputToClipBoard.ps1
function Save-ConsoleOutputToClipBoard {
[OutputType('string')]
[CmdletBinding()]
param
()
if ($host.Name -ne ‘ConsoleHost’) {
write-host -ForegroundColor Red "This script runs only in the console host. You cannot run this script in $($host.Name)."
}
View dashboard.ps1
Start-UDDashboard -Wait -Dashboard (
New-UDDashboard -Title "Hello, Azure" -Content {
New-UDCard -Title "Hello, Azure"
}
)
$scriptblock = {
New-UdGrid -Title 'Courses' -DefaultSortColumn 'Completion Deadline' -Headers @('Name', 'Completion Deadline', 'Stage Name') -Properties @('Name', 'Completion Deadline', 'Stage Name') -Endpoint {
$params = @{
BaseIdentity = 'Courses'
View Debug-Error.ps1
function Debug-Error {
[OutputType([void])]
[CmdletBinding()]
param
()
$action = {
if ($_ -and ($stacktrace -notmatch '^\s*at System\.Management\.Automation\.ExceptionHandlingOps\.CheckActionPreference') -and ($stacktrace -notmatch '^\s*at System\.Management\.Automation\.MshCommandRuntime\.ThrowTerminatingError\(ErrorRecord errorRecord\)\s*$')) {
break
}
View PowerShell.ps1
## Test file
Set-Content -Path 'foo.txt' -Value 'This is a test file'
## Run any command and pipe to my fictional function
Get-Content -Path C:\foo.txt -Raw | Copy-CommandToClipBoard
## When pasting from the clipboard, it would look like this
Get-Content -Path C:\foo.txt -Raw
This is a test file
View Twitter PowerShell search query.txt
PowerShell lang:en-us -Sharepoint -Obfuscation -obfuscator -Payload -mimikittenz -exploits -blackhat -cybersec -pentest -metasploit -exploit -exploitation -#pentesting -penetration -attack -attacks -trojan -obfuscation -pen -hijacking -logitech -malware -phishing -infosec -virus -ransomware -powerops -offensive
View copyandrun.ps1
$servers = Get-Content -Path C:\servers.txt
$folder = 'C:\Foo'
$user = 'foo'
$pass = 'password'
$secpasswd = ConvertTo-SecureString $pass -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($user, $secpasswd)
$servers | foreach {
View enuminmodule.ps1
##foo.psm1
#####################
$ServiceAppMap = @{
RAS = 'Web' ## DeployWebApplication
EDW = 'Custom' ## Has it's own Install-<App> function
LSA = 'Custom'
LDI = 'Custom'
LDA = 'Web'
LAE = 'Web'
View test
function Get-CacheOptions
{
[CmdletBinding()]
[OutputType('bool')]
param(
[Parameter(Mandatory=$true)]
[System.Web.Services.Protocols.SoapHttpClientProtocol]$ssrsproxy,
[Parameter(Mandatory=$true)]
[string]$path
)
You can’t perform that action at this time.