Skip to content

Instantly share code, notes, and snippets.

@mislavs
Created January 11, 2022 11:58
Show Gist options
  • Save mislavs/3bb7d966d4327ce78787c8af6aebd680 to your computer and use it in GitHub Desktop.
Save mislavs/3bb7d966d4327ce78787c8af6aebd680 to your computer and use it in GitHub Desktop.
Adds the nullable disable pragma to every child .cs file
Get-ChildItem $PWD -Filter *.cs -Recurse |
Where-Object {$_.FullName -notlike "*\bin\*" -and $_.FullName -notlike "*\obj\*" -and $_.FullName -notlike "*\Migrations\*"} |
Foreach-Object{
$content = Get-Content $_.FullName
Set-Content $_.FullName -value "#nullable disable", $content
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment