This file contains hidden or 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
| using System; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| using System.Threading.Tasks; | |
| using Windows.Media.SpeechRecognition; | |
| using System.Windows.Controls; | |
| using System.Windows.Input; | |
| using Westwind.Utilities; | |
| using MarkdownMonster.Windows; | |
| using Windows.Globalization; |
This file contains hidden or 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
| #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 |
This file contains hidden or 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
| These are the files used in Effortless SQL Query Crafting: Unleashing GitHub Copilot's Power post. See here: | |
| https://medium.com/@massimopiccardo/effortless-sql-query-crafting-unleashing-github-copilots-power-d09136e92de8 | |
| DatabaseContextCreation_base.sql --> A basic query to generate a list of comments to use as a context for copilot generated queries | |
| DatabaseContextCreation_relations.sql --> An evolution of the base one, adding foreing keys information | |
| DatabaseContextCreation_descriptions.sql --> Another evolution, adding table and column free text descriptions | |
| sp_AddUpdateDescription.sql --> A stored procedure to simplify the definition of descriptions ofr tables and columns | |
This file contains hidden or 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
| <# : | |
| @echo off & setlocal & set __args=%* & %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -Command Invoke-Expression ('. { ' + (Get-Content -LiteralPath ""%~f0"" -Raw) + ' }' + $env:__args) & exit /b %ERRORLEVEL% | |
| #> Add-Type @' | |
| // ========== BEGIN C# CODE ========== | |
| using System; | |
| public class App | |
| { | |
| public static void Run(string[] args) | |
| { |
This file contains hidden or 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
| Set-StrictMode -Version Latest | |
| $ErrorActionPreference = "Stop" | |
| function Enable-IISAssemblyDebugging | |
| { | |
| param( | |
| [string]$Path = ".", | |
| [string]$Filter = "*.dll" | |
| ) |
This file contains hidden or 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
| param ( | |
| [switch]$RenameOrphanLayers | |
| ) | |
| If ($RenameOrphanLayers) { | |
| Write-Warning "$($env:COMPUTERNAME) -RenameOrphanLayers option enabled, will rename all orphan layers" | |
| } | |
| # Get known layers on Docker images | |
| [array]$ImageDetails += docker images -q | ForEach { docker inspect $_ | ConvertFrom-Json } |
This file contains hidden or 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
| using System; | |
| using System.Runtime.InteropServices; | |
| /// <summary> | |
| /// From: https://www.codeproject.com/Articles/3792/C-does-Shell-Part-4 | |
| /// Note: The UCOMIEnumString interface is deprecated in .NET as of 2018! | |
| /// </summary> | |
| public class AutoCompleteExt { | |
| public static Guid CLSID_AutoComplete = new Guid("{00BB2763-6A77-11D0-A535-00C04FD7D062}"); |
This file contains hidden or 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
| logman --% start dotNetTrace -p Microsoft-Windows-DotNETRuntime (JitKeyword,NGenKeyword,InteropKeyword,LoaderKeyword) win:Informational -o dotNetTrace.etl -ets | |
| # Do your evil .NET thing now. In this example, I executed the Microsoft.Workflow.Compiler.exe bypass | |
| # logman stop dotNetTrace -ets | |
| # This is the process ID of the process I want to capture. In this case, Microsoft.Workflow.Compiler.exe | |
| # I got the process ID by running a procmon trace | |
| $TargetProcessId = 8256 |
This file contains hidden or 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
| # https://gist.github.com/timabell/bc90e0808ec1cda173ca09225a16e194 | |
| # MIT license | |
| $exts=@( | |
| "csv", | |
| "csproj", | |
| "json", | |
| "log", | |
| "md", | |
| "patch", | |
| "sql", |
This file contains hidden or 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
| # Get-EvengLog doesn't quite work I guess: | |
| # https://stackoverflow.com/questions/31396903/get-eventlog-valid-message-missing-for-some-event-log-sources# | |
| # Get-EventLog Application -EntryType Error -Source "DistributedCOM" | |
| # The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID | |
| #$logs = Get-EventLog -LogName "System" -EntryType Error -Source "DCOM" -Newest 1 -Message "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID*" | |
| # 2 is error | |
| # 3 is warning | |
| $EVT_MSG = "The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID" | |
| # Search for System event log ERROR entries starting with the specified EVT_MSG | |
| $logEntry = Get-WinEvent -FilterHashTable @{LogName='System'; Level=2} | Where-Object { $_.Message -like "$EVT_MSG*" } | Select-Object -First 1 |
NewerOlder