PowerShell Code Generator
Brings rich PowerShell functionalities into VS Templating. You can access the file system, the registry, and many other PowerShell features. You can also run PowerShell cmdlets, import modules and more. See
PowerShell Code Generator Documentation.
This example creates a function New-Class that generates a class and properties. This function can easily be placed in the PowerShell Code Generator profile which is stored in
$PSCGProfile. PowerShell code stored there is accessible at all times for templating needs.
VS 2010 PowerShell Templates
Here a the templates currently included.
Examples
PowerShell
$extension="generated.cs"
"
// <auto-generated>
// Generated at $(Get-Date)
// </auto-generated>
"
Generates
Static SQL Example
$extension="sql"
"
create procedure Products_Delete
@ProductID int
as
delete from Products
where ProductID = @ProductID
"
Generates
