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
1
vote
1 answer

SQLPS tab completion is very slow

SQLPS tab expansion (tab completion) is so slow, it is completely unusable. Is there something wrong with my configuration? Is there a later version I should somehow upgrade to? Is there some kind of fix that would make this usable? Relevant…
Kevin Berridge
  • 6,251
  • 6
  • 41
  • 42
0
votes
1 answer

SQLPS to set IPALL TCP port as part of automated SQL Server bootstrap install

I am very close to achieving a fully automated install of SQL Server with TCP/IP enabled, the IPALL TCP/IP port set to my chosen port e.g. "12345". The script is a batch file that installs SQL using a config file; echo Silent SQL Install, Please…
Tika9o9
  • 405
  • 4
  • 22
0
votes
1 answer

PowerShell script to add domain user to multiple servers with results (success / failure)

I am a PowerShell newbie and I am having trouble with a script. Basically, I have created a script that will add a sysadmin to multiple SQL servers listed in a text file. The text file is just one column of server names. The script seems to work…
0
votes
1 answer

Using user defined assemblies from Powershell

I am trying to extract list of user defined assemblies through PowerShell for one of SQL Server administration for automation. When I open SSMS and execute this query as Select name, permission_set_desc From sys.assemblies I am able to get the…
0
votes
1 answer

PowerShell failure when connecting to SQL Server

I am just trying to establish a connection with the SQL Server. The situation is that PowerShell is running on my machine and there is no instance of the sever on my machine. This SQL Server is on another server, Server9. If I have to look at the…
Brute
  • 121
  • 1
  • 10
0
votes
1 answer

Trouble executing SQLPS or PowerShell from T-SQL script using xp_cmdshell

I had originally created a set of scripts to extract the results from a system of dynamic queries to CSV using SQLCMD. However, due to large text fields in the datasets containing a large amount of formatting codes, the CSV files became unwieldly. I…
Tom
  • 31
  • 2
0
votes
0 answers

Code not being seen if I include it from a file

I'm writing some Powershell scripts to manage a SQL Server. When I create my SMO object, I do a test to see if I can list my databases. If so, then I assume I'm connected and call a function (via an included file) that has an Invoke-Sqlcmd that…
0
votes
1 answer

DBATOOLS - Copy Data from table and create on DestinationDatabase

DbaTools Related - https://dbatools.io/functions/ Hello, I am trying to find a solution to copy a table and create it on the -Destination / -DestinationDatabase, please. I am using: Get-DbaTable -SqlInstance "Machine1" -Database DBA -Table "Table01"…
Gabi
  • 21
  • 1
  • 6
0
votes
1 answer

Can't connect to database using PowerShell

I'm having issues with sqlps in my PowerShell script. I'm trying to select rows from a table and save them to a .csv file. The query is $TABLE="events" Import-Module sqlps $SQLquery='SELECT * FROM dbo.$TABLE' $result=invoke-sqlcmd -query $SQLquery…
0
votes
0 answers

ORA-00600: internal error code, arguments: [dbkif_find_next_record_1]

I m trying to start my database by sqlPlus : but I get this error : SQL> startup Instance ORACLE lancÚe. Total System Global Area 1686925312 bytes Fixed Size 2176368 bytes Variable Size 1207962256 bytes Database…
infox09
  • 5
  • 4
0
votes
1 answer

Restore-SqlDatabase Wait operation timeout

I have setup a process for Restoring Databases using the Restore-SqlDatabase cmdlet and scheduled this into a SQl Agent job. It's been working fine until I tried to restore a 160GB database. It basically fails after 600s with the error "The wait…
0
votes
1 answer

Import SQLPS module and use it to backup and restore DB to different server

I am running PS script from the client machine (Win7) that does not have SQLPS (Ms SQL Server Database Engine) installed. Due to this, I do it through importing a remote ps-session: Create remote PS-Session to the SQL…
televisi
  • 11
  • 2
0
votes
1 answer

SQLPS/AzureRm.Profile modules stopped working on Azure VM image

I have a CI build process that's been working great for months. Despite having no changes, it suddenly broke and now consistently fails with this error: The 'Backup-SqlDatabase' command was found in the module 'SQLPS', but the module could not be…
sirdank
  • 3,351
  • 3
  • 25
  • 58
0
votes
1 answer

PowerShell v2.0 SQLPS If Days between are greater than #

I am working on a PowerShell script to generate a HTML report from a SQL Server 2008 R2 query. The current script shows as: $Date = Get-Date $Summary = Invoke-SQLcmd -Query $Qry | Select-Object -Property 'Oldest Work Date' $Summary | ForEach-Object…
MLowry54
  • 13
  • 5
0
votes
1 answer

Import-Module SQLPS Not Recognized on on TFS 2015

I am adding integration tests to our CI build process. I have a database project that is deployed (via dacpac) to a localDb instance on the TFS server. (working) The next step is to load the test data into the database. I am trying to import the…
JDBennett
  • 1,323
  • 17
  • 45