/build/static/layout/Breadcrumb_cap_w.png

AdminStudio Tips & Tricks: Setting Up AdminStudio Snapin in PowerShell

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.


Comments

This post is locked
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ