To be able to use the snap-in library you need to register it first. I know this sounds obvious, but I come from a technical support background... so stay with me.

Pre-requisites

For the machine where you plan to use the tabular database cmdlets. This pre-requisites apply to the machine where you want to run the cmdlets; you don't have to run this cmdlets in the same machine your AS Tabular service is running.
  • SQL Server 2012, Microsoft.AnalysisServices.dll
  • Powershell 2.0 or above
  • .Net 4.0
  • PowerShell needs to be configured to run .Net 2 and .Net 4 versions of the framework

Configure PowerShell for .Net 4 and .Net 2

To configure PowerShell you need to update the 'powershell.exe.config' file; also, if you plan to use the PowerShell ISE, you'll need to update the 'powershellise.exe.config_' file too.
Usually the config files are located at: C:\Windows\System32\WindowsPowerShell\v1.0\. If this is not the location of your PowerShell files, you can find the location of the config folder with this simple PS command:
cd $pshome


With notepad, or similar editor, open the config file and add the necessary tags, so the file contains the following code:
<configuration> 
    <startup useLegacyV2RuntimeActivationPolicy="true"> 
        <supportedRuntime version="v4.0.30319"/> 
        <supportedRuntime version="v2.0.50727"/> 
    </startup> 
</configuration>

Make sure the version numbers in the tags above match those in your .Net framework folders
Usually, .Net framework folders are located at: C:\windows\Microsoft.NET\Framework\ and C:\windows\Microsoft.NET\Framework64\ (the latter if you are running x64 bits OS).

Register Snap-in

The steps to register the library are simple:
1.- Open PowerShell with administrative privileges
2.1.- For 64 bit OS
a) Copy and paste the following instructions to notepad, to edit them before executing them
set-alias installUtil <windir>\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe

cd <download folder for TabularDatabaseCmdlet.dll>

installUtil .\TabularDatabaseCmdlet.dll

get-PSsnapin -registered


b) Replace <windir> and <download folder for TabularDatabaseCmdlet.dll> with the appropriate values
c) Run the script in PowerShell window
d) Verify the output of get-PSsnapin shows the snap-in library is installed
2.2.- For 32 bit OS
a) Copy and paste the following instructions to notepad, to edit them before executing them
set-alias installUtil <windir>\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe

cd <download folder for TabularDatabaseCmdlet.dll>

installUtil .\TabularDatabaseCmdlet.dll

get-PSsnapin -registered

b) Replace <windir> and <download folder for TabularDatabaseCmdlet.dll> with the appropriate values
c) Run the script in PowerShell window
d) Verify the output of get-PSsnapin shows the snap-in library is installed

Last edited Oct 23, 2012 at 9:39 PM by JuanPabloJofre, version 13

Comments

No comments yet.