Skip to content

Instantly share code, notes, and snippets.

View cameronkollwitz's full-sized avatar
💭
Cobalt Strike... Cobalt Strike everywhere...

Cameron Kollwitz cameronkollwitz

💭
Cobalt Strike... Cobalt Strike everywhere...
View GitHub Profile
#Requires -Version 6
# Version 1.2.4
# check if newer version
$gistUrl = "https://api.github.com/gists/198cb33afea7585d915abc08f6a849e7"
$latestVersionFile = Join-Path -Path ~ -ChildPath ".latest_profile_version"
$versionRegEx = "# Version (?<version>\d+\.\d+\.\d+)"
if (Test-Path $latestVersionFile) {
@cameronkollwitz
cameronkollwitz / Start-Sleep.ps1
Created March 31, 2021 00:59 — forked from ctigeek/Start-Sleep.ps1
Powershell sleep function, with progress bar.
function Start-Sleep($seconds) {
$doneDT = (Get-Date).AddSeconds($seconds)
while($doneDT -gt (Get-Date)) {
$secondsLeft = $doneDT.Subtract((Get-Date)).TotalSeconds
$percent = ($seconds - $secondsLeft) / $seconds * 100
Write-Progress -Activity "Sleeping" -Status "Sleeping..." -SecondsRemaining $secondsLeft -PercentComplete $percent
[System.Threading.Thread]::Sleep(500)
}
Write-Progress -Activity "Sleeping" -Status "Sleeping..." -SecondsRemaining 0 -Completed
}
Function Remove-ADComputerUserProfile {
<#
.SYNOPSIS
Delete user profiles on local or remote computer, the session in which you are running the script must be started with elevated user rights (Run as Administrator).
.DESCRIPTION
This script delete the user profiles on local o remote computer that match the search criteria.
.PARAMETER UserName
User Name to delete user profile, is possible use the '*' wildchar.
@cameronkollwitz
cameronkollwitz / connect.ps1
Created November 19, 2021 18:17 — forked from codebykyle/connect.ps1
Windows Terminal Split Pane Powershell Script - v2
using namespace System.Collections.Generic
# Encapsulate an arbitrary command
class PaneCommand {
[string]$Command
PaneCommand() {
$this.Command = "";
}
@cameronkollwitz
cameronkollwitz / MakePowerShellRememberSSHPassphrase.md
Created March 5, 2022 23:22 — forked from danieldogeanu/MakePowerShellRememberSSHPassphrase.md
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
// origin: http://www.google.com/support/forum/p/Chrome/thread?tid=1a37ccbdde5902fd&hl=en
javascript:
timeout=prompt("Set timeout [s]");
current=location.href;
if(timeout>0)
setTimeout('reload()',1000*timeout);
else
location.replace(current);
function reload(){
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@cameronkollwitz
cameronkollwitz / setupmachine.bat
Created January 6, 2024 23:07 — forked from shanselman/setupmachine.bat
WinGet Setup a New Machine
mkdir c:\github
winget install --id=Git.Git -e --accept-package-agreements --accept-source-agreements
winget install --id=Microsoft.VisualStudioCode -e
winget install --id=AgileBits.1Password -e
winget install --id=7zip.7zip -e
winget install --id=Twilio.Authy -e
winget install --id=Bethesda.Launcher -e
winget install --id=Microsoft.Bicep -e
winget install --id=Microsoft.bitsmanager -e
winget install --id=BrutalChess.BrutalChess -e