Skip to content

Instantly share code, notes, and snippets.

@benhar-dev
Created January 17, 2023 03:16
Show Gist options
  • Save benhar-dev/f2611189230d0ff0f9919359f2518dee to your computer and use it in GitHub Desktop.
Save benhar-dev/f2611189230d0ff0f9919359f2518dee to your computer and use it in GitHub Desktop.
Powershell - Automation Interface
$prjDir = "C:\dev\demo-automation-interface-hmi\"
$prjName = "demo-automation-interface-hmi.sln"
$prjPath = $prjDir += $prjName
$dte = new-object -com TcXaeShell.DTE.15.0
$dte.SuppressUI = $false
$dte.MainWindow.Visible = $true
$sln = $dte.Solution
$sln.Open($prjPath)
$project = $sln.Projects.Item(1)
$systemManager = $project.Object
$configManager = $systemManager.ConfigurationManager
Write-Host $dte.Solution.SolutionBuild.ActiveConfiguration.Name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment