Skip to content

Instantly share code, notes, and snippets.

View brunomartinspro's full-sized avatar
🚀

Bruno Martins brunomartinspro

🚀
View GitHub Profile
@brunomartinspro
brunomartinspro / UpdateallGitRepositoriesInFolder.ps1
Created November 7, 2019 16:00
Update all Git Repositories in a Folder
$currentLocation = get-location
Write-Host("Current Location: $currentLocation")
$directories = Get-Childitem -Path $currentLocation -Directory
foreach($directory in $directories)
{
Write-Host("-------------- Starting $directory --------------")
@brunomartinspro
brunomartinspro / development.reg
Last active August 7, 2019 10:55
Add development files to New section of Windows Context Menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.ps1\ShellNew]
"NullFile"=""
[HKEY_CLASSES_ROOT\.psm1\ShellNew]
"NullFile"=""
[HKEY_CLASSES_ROOT\.cs\ShellNew]
"NullFile"=""
@brunomartinspro
brunomartinspro / delete_nuget_cache_using_powershell.ps1
Created August 5, 2019 14:05
Delete Nuget Cache using Powershell
$Regex = "PROJECTNAME*."
$Path = "$env:LOCALAPPDATA\NuGet"
Get-ChildItem "$Path" -Recurse | Where{$_.Name -Match "$Regex"} | Remove-Item -Recurse -Verbose
Write-Output("Cleaned: $Path")
$Path = "C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\"
Get-ChildItem "$Path" -Recurse | Where{$_.Name -Match "$Regex"} | Remove-Item -Recurse -Verbose
@brunomartinspro
brunomartinspro / modify_net_core_nuget_package_version_using_powershell.ps1
Last active August 14, 2019 17:49
Modify .Net Core Nuget Package Version using Powershell
$filePath = "$(Build.SourcesDirectory)"
$projectNameFilter = "MYBASEPROJECTNAME.*"
Write-Output ("package version: $(NugetVersion)")
Get-ChildItem "$filePath" -Filter "$projectNameFilter.csproj" -recurse | Foreach-Object {
Write-Output ("----------------- CSPROJ FILTER: " + $_.FullName + "----------------------")
try {
$regex = '(?<=<Version>)[^<]*'
@brunomartinspro
brunomartinspro / gitflow_branch_regex.txt
Created April 18, 2019 14:15
GitFlow Branch Regex
(^((develop|master)(?!-.*)))|((release|feature|hotfix|task|story)(-.*))
@brunomartinspro
brunomartinspro / npm-gui.bat
Last active December 12, 2018 11:08
NPM Package Manager Graphic User Interface
npm install -g npm-gui
cd c:\your-prject-folder
npm-gui localhost:9000
@brunomartinspro
brunomartinspro / sqlserverlargecommand
Last active September 6, 2018 17:19
run large sql server sql queries
sqlcmd -S <server> -i C:\<your file here>.sql
#
Sqlcmd [-U login id] [-P password]
[-S server] [-H hostname] [-E trusted connection]
[-d use database name] [-l login timeout] [-t query timeout]
[-h headers] [-s colseparator] [-w screen width]
[-a packetsize] [-e echo input] [-I Enable Quoted Identifiers]
[-c cmdend] [-L[c] list servers[clean output]]
[-q "cmdline query"] [-Q "cmdline query" and exit]
@brunomartinspro
brunomartinspro / ClearGitCredentials.bat
Created August 30, 2018 15:23
Clear git credentials
git config --global credential.helper wincred
@brunomartinspro
brunomartinspro / IISPoolViewer.bat
Last active August 22, 2018 20:25
View process id of IIS Application Pools
cd %windir%\system32\inetsrv\
appcmd list wp
@brunomartinspro
brunomartinspro / ADErrorUtils.cs
Created August 7, 2018 14:48
Reproduce System.AccessViolationException exception when using Active Directory Searcher
using System;
using System.DirectoryServices;
namespace BrunoMartinsPro.TriggerErrors
{
public class AdErrorUtils
{
public void TriggerError()
{
//Define connection properties