Skip to content

Instantly share code, notes, and snippets.

@kentcooper
Created April 9, 2015 05:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kentcooper/7c1ed9c3fc791be15282 to your computer and use it in GitHub Desktop.
Save kentcooper/7c1ed9c3fc791be15282 to your computer and use it in GitHub Desktop.
Update Visual Studio item templates to resolve issue with Add Class context menu
$cSharpFiles = Get-ChildItem D:\GitHub\side-waffle\TemplatePack\ItemTemplates\Web CSharp.vstemplate -Recurse -Exclude D:\GitHub\side-waffle\side-waffle\TemplatePack\ItemTemplates\Web\ASP.NET
foreach($filePath in $cSharpFiles){
$updatedFile = $false
'Processing [{0}]' -f $filePath | Write-Host
(Get-Content $filePath.PSPath) |
Foreach-Object {$_ -replace "ABC \| \(!ABC\)", "!VB"} |
Set-Content $filePath.PSPath
}
$vbFiles = Get-ChildItem D:\GitHub\side-waffle\TemplatePack\ItemTemplates\Web VB.vstemplate -Recurse -Exclude D:\GitHub\side-waffle\side-waffle\TemplatePack\ItemTemplates\Web\ASP.NET
foreach($filePath in $vbFiles){
$updatedFile = $false
'Processing [{0}]' -f $filePath | Write-Host
(Get-Content $filePath.PSPath) |
Foreach-Object {$_ -replace "ABC \| \(!ABC\)", "!CSharp"} |
Set-Content $filePath.PSPath
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment