This file contains 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
Clear-Host | |
$module = Get-Module tcdbtools | |
if (!$module) { | |
Install-Module tcdbtools -Force | |
} | |
Import-Module tcdbtools | |
$module = Get-Module SqlServer | |
if (!$module) { | |
Install-Module SqlServer -Force | |
} |
This file contains 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-WmiObject Win32_Process -Filter "name = 'w3wp.exe'" | | |
Where-Object {$_.CommandLine -imatch "appPoolName"} | | |
Select-Object ProcessId, Name, CommandLine |
This file contains 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
<Project> | |
<PropertyGroup> | |
<!--ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally--> | |
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <!-- True for new projects, false for existing ones with lots of warnings --> | |
<TargetFramework>net8.0</TargetFramework> | |
<Nullable>enable</Nullable> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<PublishReadyToRun>true</PublishReadyToRun> | |
<SelfContained>true</SelfContained> | |
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages> |
This file contains 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
Clear-Host | |
<# | |
PURPOSE: To scan all of the projects in a directory and compare the PackageReferences to the | |
Directory.Packages.props PackageVersions. Outputs if any are missing from the Directory.Packages.props | |
#> | |
$solutionFolder = "C:\..solution path..\" | |
$files = (Get-ChildItem $solutionFolder -Recurse -Filter "*.csproj").FullName |
This file contains 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
Clear-Host | |
<########################################################################### | |
Author: Tim Cartwright | |
Purpose to turn off client ip masking for all application insights resources if masking is enabled | |
DisableIPMasking: | |
- true: disable masking client ips with 0.0.0.0 and show the real client ip | |
- false: masks all client ips with 0.0.0.0 |
This file contains 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.Data.Common; | |
using System.Diagnostics; | |
using Microsoft.EntityFrameworkCore.Diagnostics; | |
namespace ~~~~~; | |
public class EFCommandInterceptor : DbCommandInterceptor | |
{ | |
public override InterceptionResult<int> NonQueryExecuting(DbCommand command, CommandEventData eventData, InterceptionResult<int> result) |
This file contains 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.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Runtime.CompilerServices; | |
using System.Text; | |
using System.Threading.Tasks; | |
public static class ObjectExtensions | |
{ |
This file contains 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
dotnet restore --no-cache --force | |
OR | |
nuget restore -nocache -force | |
LAST RESORT, CLEAR THE LOCAL CACHE: | |
nuget locals all -clear |
This file contains 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
/*****************************************************************************************************************************************/ | |
/**** SHRINK LOG FILES *******************************************************************************************************************/ | |
/*****************************************************************************************************************************************/ | |
DECLARE @sql VARCHAR(max) = '' | |
SELECT @sql += CONCAT('USE [', DB_NAME([mf].[database_id]), ']', CHAR(13), CHAR(10), 'DBCC SHRINKFILE (''', [mf].[name], ''', 1) WITH NO_INFOMSGS;', CHAR(13), CHAR(10)) | |
FROM sys.[master_files] AS [mf] | |
WHERE [mf].[type_desc] = 'LOG' |
This file contains 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
@rem remove last commit and destroy it | |
git reset --hard HEAD~1 | |
@rem remove last commit and edit it | |
git reset HEAD~1 |
NewerOlder