Questions tagged [sqlps]

The sqlps utility starts a Windows PowerShell 2.0 session with the SQL Server PowerShell provider and cmdlets loaded and registered.

The sqlps utility starts a Windows PowerShell 2.0 session with the SQL Server PowerShell provider and cmdlets loaded and registered. You can enter PowerShell commands or scripts that use the SQL Server PowerShell components to work with instances of SQL Server and their objects.

Click Here for documentation.

58 questions
0
votes
0 answers

Drop/Create Azure Database On Build

I'm setting up a post-git push trigger on an Azure web app that pulls in the latest web app build, and the latest database build and deletes/recreates the DB again from scratch using the latest database build. I was hoping to achieve the…
walshy002000
  • 99
  • 1
  • 10
0
votes
1 answer

Calling a powershell function, sending parameters via splatting

I have a Powershell function that is calling "Restore-SqlDatabase" from the SqlPs module and sends parameters to the function via splatting. I'm trying to figure out why it's not working the way I expect it to. Here's my code: $SqlParams =…
Ethan Eiter
  • 101
  • 9
0
votes
2 answers

How to import SQLPS module into Azure Automation?

I'm trying to connect to a Azure SQL server (under a different subscription) using SQLPS Auth method is SQL server auth. When I try to import-module SQLPS, I get this error: Error: import-module : The specified module 'sqlps' was not loaded …
0
votes
1 answer

#sqlps - Problems connecting to the server to query

I'm trying to connect to a server\instance hosted remotely. The server is in a domain to which I'm connected as well (I'm able to login using SQL Server auth with the provided credentials from SSMS, locally) Import-Module SQLPS $query = 'select…
0
votes
1 answer

Powershell load module in same session

I am installing the sqlps module by running PowerShellTools.msi. After that has been installed I need to use that module in my ps script so I try to do "Import-Module 'sqlps' -DisableNameChecking". But the module is not found. I have to restart…
supremo
  • 131
  • 1
  • 1
  • 9
0
votes
1 answer

Pass a query and access SQL Server Database in Powershell

I have a database named 'SQLDatabase'. It has many folders like 'System _Database', 'R_Database','ReportServer' etc. I need to access 'R_Database'. Now 'R_Database' has many folders like 'Storage', 'Security', 'Usage', 'Tables'. I need to access…
ruchasn
  • 43
  • 5
0
votes
1 answer

Create a Differential backup using SQLPS

I have created a FULL database backup using the following: Backup-SQLDatabase -ServerInstance $sqlServer -Database $db.name -BackupFile $fullBackupFilePath -BackupAction Database I cannot find anywhere specifying the correct -BackupAction for a…
Ryan Gillooly
  • 315
  • 1
  • 5
  • 20
0
votes
2 answers

SQL Powershell error - Network path not found

I am using PowerShell commands in my SQL job to get the list of files in a given network path. Ex: Get-ChildItem -path \\\ServerName\ShareName\\ I have created proxies for PowerShell in SQL Server and using a credential to run this PowerShell…
Sandeep
  • 1
  • 1
0
votes
1 answer

Enumerate Databases Using SQL PowerShell

I'm using PowerShell 4.0 and the SQLPS plugin for working with SQL Server. ForEach($Database in (Get-ChildItem -FORCE SQLSERVER:\SQL\localhost\DEFAULT\Databases)) { Write-Host $Database } This outputs a list of database I have locally such…
Karl Kieninger
  • 8,841
  • 2
  • 33
  • 49
0
votes
1 answer

PowerShell Installing additional tools and use cmdlets installed

I am installing some MSI package in a powershell script like that : Start-Process "Msi_Path" /qn -Wait these MSI package are : SQLSysClrTypes.msi,SharedManagementObjects.msi,PowerShellTools.msi (For SQL Server 2012) In the same script, after…
0
votes
3 answers

Powershell SQLPS module not importing within C#

I'm attempting to execute a SQL Query from within Powershell, within C#. I have been successful in doing so with ActiveDirectory cmdlets and wanted to take it one step further. My first issue is while the following format works with ActiveDirectory…
squid808
  • 1,430
  • 2
  • 14
  • 31
0
votes
1 answer

How can I resolve the error SQLPS failed to initialize?ows

Environment: Windows Server 2008 R2 64 bit SQL Server 2008 R2 Installed the Microsoft Windows Management Framework 3.0 plus it's prerequisites to get Powershell 3.0 On server Powershell prompt I get this: PS C:\Users\macfarmw> sqlps SQLPS failed to…
Matthew MacFarland
  • 2,413
  • 3
  • 26
  • 34
-1
votes
1 answer

How do I get the initial database size in PowerShell SQLPS?

I have been searching for a few days now on how to get the initial size of a database and its logs files via PowerShell SQLPS module. For some unknown reason this information is not included in the properties of the returned object from the…
GKman
  • 503
  • 1
  • 5
  • 19
1 2 3
4