How to install Microsoft PowerShell SqlServer module
To retrieve DDL information from Microsoft SQL Server, DATPROF Runtime uses a specific PowerShell module.
This is used in DATPROF Privacy and DATPROF Subset, also when they are deployed using DATPROF Runtime.
Back in in time Microsoft used the module SQLPS. Nowadays Microsoft has replaced this module by the "SqlServer" module.
In most cases this module is not installed on your system and you should install it on your system.
To do this Microsoft PowerShell version 5 is required.
Step-by-step guide with Internet
To check and install the correct PowerShell version follow this instruction:
- Open a PowerShell window on your system "as administrator"
- Check the PowerShell version: $psversiontable.Psversion
- If the major version below 5 upgrade your PowerShell by downloading/installing "Windows Management Framework" version 5.x.
(https://www.microsoft.com/en-us/download/details.aspx?id=54616)
To install the required SqlServer module execute this: - Open a PowerShell window on your system "as administrator"
- Install the module by using this command: Install-Module -Name SqlServer
Step-by-step guide without Internet
- Open a PowerShell window on your system "as administrator"
- Check the PowerShell version: $psversiontable.Psversion
- If the major version below 5 upgrade your PowerShell by downloading/installing "Windows Management Framework" version 5.x.
(https://www.microsoft.com/en-us/download/details.aspx?id=54616)
To install the required SqlServer module execute this: - Open a PowerShell window on your system "as administrator"
- Download the SqlServer PowerShell module using the manual download
- Extract the SqlServer.<version>.nupkg with a tool like 7zip into a folder called SqlServer
Enter the following statement inside PowerShell to find out where modules are stored
$Env:PSModulePath -split ';'
- Copy the extracted SqlServer folder to one of the folders that is listed using the command in 5.
- Check with the following PowerShell statement if the module can be found
Get-Module -ListAvailable SqlServer - This will return something like: