I’ve gobbled together a basic Powershell script to query W10’s Windows Desktop Search (WDS) index. Here is the relevant bits, Until now my tests have been using single words and everything works. But when I started using two words, it falls apart with the following error, Using Explorer to query the index using content:”and then” works fine. Any ideas? Answer
Tag: powershell
Powershell mail every user from SQL query
Unfortunately, I could not find my answer from all the examples I came across. I have a SQL query that contains the following values First name Suffix Last Name Email address Now I want to send a mail per record and in the mail mention the name. Below is the code that doesn’t do the loop right now and puts
Trying to extract data form SQL using PS script
I have been trying to get a PS script to work in extracting files (pdf, word, etc.) from an SQL Server database. I came across the PowerShell script below. The script runs and populates the destination folder but all files are 0 bytes and during the script execution. It throws the error: “Exporting Objects from FILESTREAM container: .docx Exception calling
execute powershell from SSMS
I am trying to execute as certain xp_cmdshell code: but this is the error that I get: when I try an execute the same thing in powershell I get the expected response(see image) Powershell The expected output from the xp_cmdshell should be a json Answer The error message implies that your command line is being executed via cmd.exe, where &
Return the Data from Column Using PowerShell
When I export the $dt to a CSV – it shows in 1.A of Excel = 1 and in 2.A = 2. I need to extract the two value of the second row in column A. First why is the count working? And why do I not get a return for the values in the last two echo commands when
Powershell sorting columns
I was able to sort the column and remove duplicates using -Unique My problem is that I can’t remove a specific row using the status property ID Name Status 1 John Current 1 John Future 2 Mary Future 2 Mary Notice 3 Paul Future I want the rows to be unique by status order. Current Notice Future Example: If there’s
Powershell, invoke-sqlcmd, export-csv fails to show data if there is more than one result
I have the below code to get data from a SQL DB and export it into a CSV file: This works perfectly if there is one result. But if there is more than one result, it will show the below in the csv file I am at my wits end as to why it is doing this. It’s obviously the
Poweshell retrieve sql query result
I am quite new to PowerShell. I have multiple SQL queries which I am executing from a PS script using SQL adapter. I need to retrieve the common results based on a column from the queries without changing existing queries or writing another one. How to achieve this with PowerShell using the results stored in a variable? I’ve tried working
Multiple Loop with a SQL Query Function – 2 Minute Interval between Queries
Need to loop twice through the query function below loading the results into two seperate variables. The query function works as expected, but need to have two unique queries stored in the two temp tables. How should I create these temporary tables that allow me to reference them as $1_resultsDataTable and $2_resultsDataTable? I will use these two tables to do
PowerShell code to script out all SQL Server Agent jobs into a single file
I was trying to script out all the SQL Server Agent jobs for category ‘Data Warehouse’ into a single file I was able to do it using PowerShell, where every single job creates a single file. But I need one file for all the SQL Server Agent jobs under category ID = 100 (or Category : = ‘Data Warehouse’) Code