Skip to content

Instantly share code, notes, and snippets.

View pa-0's full-sized avatar

Peter Abbasi pa-0

View GitHub Profile
#Requires -RunAsAdministrator
# Disable telemetry in Visual Studio 2022 - https://learn.microsoft.com/en-us/visualstudio/ide/visual-studio-experience-improvement-program?view=vs-2022
New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\VSCommon\17.0\SQM" -Name "OptIn" -Value "0" -PropertyType "DWORD" -Force
# Delete telemetry directories
Remove-Item -Path "$env:APPDATA\vstelemetry" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\VSApplicationInsights" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:PROGRAMDATA\Microsoft\VSApplicationInsights" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:TEMP\Microsoft\VSApplicationInsights" -Recurse -Force -ErrorAction SilentlyContinue
@pa-0
pa-0 / ProcessMonitor.ps1
Created June 7, 2025 02:32 — forked from Dimtemp/ProcessMonitor.ps1
Process monitor PowerShell
Function ProcessMonitor {
<#
.SYNOPSIS
Displays changes in the process list on this or a remote PC.
.DESCRIPTION
Great for monitoring logon/startup scripts, batch jobs, software installations, etc... Especially on terminal servers.
.EXAMPLE
ProcessMonitor
Compares changes in the process list every second on the local computer.
.EXAMPLE
function Update-dotNETVideo
{
[CmdletBinding()]
param (
# A path to subtitle file of folder where the subtitles are located.
[Parameter(Mandatory = $true,
ValueFromPipeline = $true,
ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $false,
Position = 0,
@pa-0
pa-0 / Get-Build2012Videos.ps1
Created May 30, 2025 23:39 — forked from Iristyle/Get-Build2012Videos.ps1
Download Build 2012 Videos
#from http://lostechies.com/erichexter/2012/11/02/download-all-the-build-videos-while-you-sleep/
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$rss = (new-object net.webclient)
#Set the username for windows auth proxy
$rss.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials
$a = ([xml]$rss.downloadstring("http://channel9.msdn.com/Events/Build/2012/RSS/wmvhigh"))
$a.rss.channel.item | foreach{
$url = New-Object System.Uri($_.enclosure.url)
$file = $url.Segments[-1]
@pa-0
pa-0 / add-voice.ps1
Last active May 30, 2025 23:02 — forked from hiepxanh/add-voice.ps
Add microsoft core voice to any application can use
$sourcePath = 'HKLM:\software\Microsoft\Speech_OneCore\Voices\Tokens' #Where the OneCore voices live
$destinationPath = 'HKLM:\SOFTWARE\Microsoft\Speech\Voices\Tokens' #For 64-bit apps
$destinationPath2 = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens' #For 32-bit apps
cd $destinationPath
<#cleanup
$listOldVoices = Get-ChildItem $destinationPath
foreach($voice in $listOldVoices) {
if ($voice.PSChildName.StartsWith("TTS_") -or $voice.PSChildName.StartsWith("IVONA 2")) {
$path = $voice.PSPath
Remove-Item -Path $path -Recurse
@pa-0
pa-0 / ansi2html.sh
Created May 29, 2025 01:48 — forked from regstuff/ansi2html.sh
Convert a colored terminal output in linux into a html file that preserves the color.
#!/bin/sh
# Convert ANSI (terminal) colours and attributes to HTML
# Licence: LGPLv2
# Author:
# http://www.pixelbeat.org/docs/terminal_colours/
# Examples:
# ls -l --color=always | ansi2html.sh > ls.html
# git show --color | ansi2html.sh > last_change.html
@pa-0
pa-0 / Test-IsWindowsTerminal.ps1
Created May 28, 2025 05:39 — forked from jdhitsolutions/Test-IsWindowsTerminal.ps1
Test if PowerShell is running in WindowsTerminal
#requires -version 5.1
Function Test-IsWindowsTerminal {
[cmdletbinding()]
[Outputtype([Boolean])]
Param()
Write-Verbose "Testing processid $pid"
@pa-0
pa-0 / CustomTitleBar.ahk
Created May 25, 2025 09:18 — forked from Lexikos/CustomTitleBar.ahk
Creating a GUI with custom titlebar in AutoHotkey v2.0
#Requires AutoHotkey v2.0
OnMessage( 0xF, PaintTitle)
OnMessage( 0x14, EraseBkgnd)
OnMessage( 0x83, NcCalcSize)
OnMessage( 0x84, NcHitTest)
OnMessage( 0xA4, NcRButtonDown)
OnMessage( 0x2A2, NcMouseLeave)
@pa-0
pa-0 / CommentsAuthor.bas
Created May 22, 2025 01:09 — forked from wyfinger/CommentsAuthor.bas
Edit comments author at selection in Word
Sub EditComment()
If ActiveDocument.Comments.Count = 0 Then Exit Sub
For i = 1 To ActiveDocument.Comments.Count
If (Selection.Start >= ActiveDocument.Comments(i).Scope.Start) And _
(Selection.Start <= ActiveDocument.Comments(i).Scope.End) Then
ActiveDocument.Comments(i).Author = InputBox(ActiveDocument.Comments(i).Author _
& vbCrLf & vbCrLf & ActiveDocument.Comments(i).Range.Text, "Author", ActiveDocument.Comments(i).Author)
End If
Next
End Sub
@pa-0
pa-0 / DocumentProperties.bas
Created May 22, 2025 01:07 — forked from ghanique/DocumentProperties.bas
VBA Macro for exporting and importing Word Document Properties
Option Explicit
Private fileName As String
Public Sub ExportProperties()
On Error GoTo ErrorHandler
Let fileName = InputBox("Export properties to ...", "Export", fileName)
Open fileName For Output As #1