Skip to content

Instantly share code, notes, and snippets.

View adbertram's full-sized avatar

Adam Bertram adbertram

View GitHub Profile
function Get-CacheOptions
{
[CmdletBinding()]
[OutputType('bool')]
param(
[Parameter(Mandatory=$true)]
[System.Web.Services.Protocols.SoapHttpClientProtocol]$ssrsproxy,
[Parameter(Mandatory=$true)]
[string]$path
)
##foo.psm1
#####################
$ServiceAppMap = @{
RAS = 'Web' ## DeployWebApplication
EDW = 'Custom' ## Has it's own Install-<App> function
LSA = 'Custom'
LDI = 'Custom'
LDA = 'Web'
LAE = 'Web'
$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 {
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
## 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
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
}
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'
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)."
}
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
{
"$schema": "http://schema.management.azure.com/schemas/2018-05-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"webAppName": {
"type": "string"
},
"sqlDbName": {
"type": "string"
}