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