Skip to content

Instantly share code, notes, and snippets.

View lazywinadmin's full-sized avatar

François-Xavier Cat lazywinadmin

View GitHub Profile
@RamblingCookieMonster
RamblingCookieMonster / OpenSource.PowerShell.ReleasePipeline.Projects.md
Last active June 26, 2016 22:47
OpenSource.PowerShell.ReleasePipeline.Projects.md
Add-Type -AssemblyName PresentationFramework, System.Drawing, System.Windows.Forms, WindowsFormsIntegration
$MainWindow=@'
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowStartupLocation="CenterScreen"
Title="Azure Cloud Explorer" Height="800" Width="800">
<Grid>
<Grid.RowDefinitions>
@alirobe
alirobe / reclaimWindows10.ps1
Last active May 14, 2025 14:03
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
### OR take a look at
### https://github.com/HotCakeX/Harden-Windows-Security
@dfinke
dfinke / Get-PSGalleryInfo.ps1
Created January 29, 2016 19:11
Get statistics for published PowerShell Gallery packages
function Get-PSGalleryInfo {
param(
[Parameter(ValueFromPipelineByPropertyName=$true)]
$Name
)
Begin {
$t = @"
{Name*:PowerShellISE-preview} {[version]Version:5.1.0.1} (this version) {[double]Downloads:885} {[DateTime]PublishDate:Wednesday, January 27 2016}
{Name*:ImportExcel} 1.97 {Downloads:106} Monday, January 18 2016
"@
@dfinke
dfinke / GetCoolFace.ps1
Last active July 15, 2024 06:19
ᕙ༼ຈل͜ຈ༽ᕗ Get a cool ascii face
# From:
# https://github.com/maxogden/cool-ascii-faces
function Get-CoolFace {
param(
$Count=1
,[Switch]$All
)
$faces = "( .-. )",
@mattifestation
mattifestation / WMI_attack_detection.ps1
Last active March 16, 2021 23:02
BlueHat 2016 - WMI attack detection demo
#region Scriptblocks that will execute upon alert trigger
$LateralMovementDetected = {
$Event = $EventArgs.NewEvent
$EventTime = [DateTime]::FromFileTime($Event.TIME_CREATED)
$MethodName = $Event.MethodName
$Namespace = $Event.Namespace
$Object = $Event.ObjectPath
$User = $Event.User
@dfinke
dfinke / Get-Snoverism.ps1
Created December 8, 2015 20:06
Wisdom form the Shellfather, Jeffrey Snover - via Don Jones
function Get-Snoverism {
(Invoke-WebRequest http://snoverisms.com/).images.src |
Where {$_ -match 'quotes'} |
Get-Random |
Where { start "http://snoverisms.com/$($_)" }
}
@ellisgeek
ellisgeek / Elevate.ps1
Last active October 7, 2024 00:54
Automatically relaunch Powershell script as Administrator
#region Elevate
function Elevate {
<#
.SYNOPSIS
Automatically (re)launch Powershell script as Administrator including parameters
.PARAMETER ScriptPath
Path to the script that should be launched. Defaults to the current script
.PARAMETER Parameters
A Hashtable of parameters that should be passed to the elevated script, where the "key" is the
parameter name and the "value" is the parameter value
@altrive
altrive / PSv5_Preview_Features.md
Last active April 24, 2016 16:45
PowerShell v5 Undocumented Features List
Note: Following features are tested on Windows 10 Preview Build 10074 environment

PSReadLine

Windows 10 Preview contains PSReadLine module at "%ProgramFiles%\WindowsPowerShell\Modules" (WMF 5.0 Preview don't contain this modules)

PSReadLine is automatically loaded when PSConsoleHost launched(if available). This feature can be controlled by following command.

@altrive
altrive / ToastNotification_Windows10.ps1
Last active May 12, 2024 09:34
Windows 10 toast notification sample
$ErrorActionPreference = "Stop"
$notificationTitle = "Notification: " + [DateTime]::Now.ToShortTimeString()
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01)
#Convert to .NET type for XML manipuration
$toastXml = [xml] $template.GetXml()
$toastXml.GetElementsByTagName("text").AppendChild($toastXml.CreateTextNode($notificationTitle)) > $null