AdminStudio Platform functionality is shipped in the form of a PowerShell Snapin that can be used in PowerShell. The AdminStudio Snapin can be installed on a machine or can be used temporarily per PowerShell session.

AdminStudio 11.5’s Microsoft .NET 4.0 Requirement

The AdminStudio 11.5 DLLs are built using .NET 4.0, while PowerShell by default runs in .NET 2.0. To enable PowerShell to load the AdminStudio 11.5 DLLs, you need to perform the following steps:

To enable PowerShell to load AdminStudio 11.5 DLLs:

  1. Create a file named PowerShell.exe.config containing the following content:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

  <!-- http://msdn.microsoft.com/en-us/library/w4atty68.aspx -->

  <startup useLegacyV2RuntimeActivationPolicy="true">

    <supportedRuntime version="v4.0.30319"/>

    <supportedRuntime version="v2.0.50727"/>

  </startup>

</configuration>

  2. Copy this file to the C:\Windows\SysWOW64\WindowsPowerShell\v1.0 directory.

Enabling a Snapin Per PowerShell Session

To enable a Snapin per PowerShell session, use the following command:

Import-Module -Name C:\Program Files (x86)\AdminStudio\11.5\Common\AdminStudio.Platform.PowerShellExtensions.dll

The following import is needed in any of the PowerShell sessions/scripts:

Import-Module -Name C:\Program Files (x86)\AdminStudio\11.5\ConflictSolver\AdminStudio.Utilities.dll

Installing the Snapin on a Machine

To install the AdminStudio Snapin on a given machine, use the following command at a PowerShell prompt:

Set-Alias installutil $env:windir\Microsoft.NET\Framework\v4.0.30319\installutil

installutil C:\Program Files (x86)\AdminStudio\11.5\Common\AdminStudio.Platform.PowerShellExtensions.dll

The following import is needed in any of the PowerShell sessions/scripts:

Import-Module -Name C:\Program Files (x86)\AdminStudio\11.5\ConflictSolver\AdminStudio.Utilities.dll

Running the Invoke-ASPublish Command

To run the Invoke-ASPublish command, you need the following import, either in your PowerShell script or the current PowerShell session:

Import-Module -Name C:\Program Files (x86)\AdminStudio\11.5\ConflictSolver\AdminStudio.SCCM.Integrator.dll

Requirements

For the AdminStudio Platform to work properly, PowerShell needs to run under administrator privileges and also needs to be launched with the -STA flag.