我正在尝试自动化在每个Web项目上执行的某些任务。我想要的是可以在新解决方案上运行的PoSH脚本,该脚本将:
到目前为止,我有一个简单的脚本(如下所示)可以找到并打开本地解决方案文件。
$scriptpath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scriptpath
Set-Location $dir
$solution = Get-ChildItem | Where-Object{($_.Extension -eq ".sln")}
if ($solution.Count -eq 0)
{
"Please place this script in the folder containing you solution file."
break;
}
$dteObj = New-Object -ComObject "VisualStudio.DTE"
$dteObj.Solution.Open($solution.FullName)
现在如何创建新项目并将其添加到解决方案中?
最佳答案
查看Jim Christopher的http://studioshell.codeplex.com/。
关于powershell - 使用PowerShell创建类库并将其添加到解决方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16130919/