119,250 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
1
answer
66
views
How to Use Virtual-Key Code Constants in Powershell?
In a Powershell script, Mute is performed with:
(New-Object -ComObject WScript.Shell).SendKeys([char]173)
That works.
Windows reference lists constants for each key. Mute constant is VK_VOLUME_MUTE.
...
0
votes
0
answers
38
views
Powershell script to replace a single carriage return [duplicate]
I am importing a web order CSV file into our in-house database. Usually it's ok but, if the user enters special delivery instructions, the csv file includes the string "help.", followed by ...
2
votes
0
answers
30
views
Azure DevOps "File Path" PowerShell task fails with "MissingEndCurlyBrace" but script parses and runs fine locally and as inline steps
Environment
Azure DevOps Classic UI
Task: PowerShell@2 (Windows PowerShell, not pwsh)
Agent: Windows (Microsoft-hosted and self-hosted both repro)
PowerShell version: Windows PowerShell 5.1
Script ...
0
votes
0
answers
51
views
PS command get-itemproperty from registry not returning all values can see when browsing with regedit
I am trying to write a script where one part of it looks for a piece of software and if it is installed in a specific version it upgrades it.
I am trying with the below line to find it in registry, ...
2
votes
1
answer
71
views
PowerShell Script: When the Ethernet Port status changes why doesn't the status report show the actual port status?
I am an occasional casual programmer (for about 60 years now!). I wrote 2 functional SNMP PowerShell desktop shortcut scripts 4 years ago. Now I am writing two scripts for my old Windows 10 system: ...
4
votes
2
answers
85
views
sqlite3 shell on Windows : extra carriage returns when using output redirection
Demonstrate the issue
Let's use nvim to create a text file:
> nvim C:\temp\in-file.txt
The contents of the text file:
> Get-Content C:\temp\in-file.txt
abc
bcd
cde
Now let's create a simple ...
4
votes
1
answer
79
views
How to suppress all output in Teams PowerShell module
I am using the Teams PowerShell Module 7.3.1 on PowerShell Core 7.5.3 to pause a provisioning script until a newly created user becomes available in the Microsoft Teams PowerShell module, as follows:
...
1
vote
3
answers
184
views
How to convert a batch to Powershell parallel processing to run over thousands of input files?
I have a large number of files (about 3800) that I want to run a program over. The program reads a WAV file and makes a short .TSV text file containing the WAV's lip-sync data (but that is by-the-by ...
1
vote
1
answer
79
views
How to run PowerShell script as admin with policy and scope
I am very bad and beginner with the PowerShell. What I need is to with the request that I receive run a powershell script. My request and response that I need looks like this:
public class MyRequest
{
...
0
votes
1
answer
63
views
MySQL USE command not working from PowerShell
Here is a snippet from a PowerShell script:
$sql.CommandText = "CREATE DATABASE IF NOT EXISTS ``$dbName``;"
$rowsInserted = $sql.ExecuteNonQuery()
$sql.CommandText = "USE ``$dbName``;&...
2
votes
0
answers
85
views
Windows 11 - Get grid size for icons on a Desktop
I would like to calculate what is the current grid size for icons on my Desktop, so I can calculate how many icons can fit in 1 layer on it.
I tried getting VerticalIconSpacing divided by -15 (which ...
-1
votes
0
answers
44
views
Terraform Utility Modules that Clones Azure Verified Module from Github to Azure Devops
I want to create a Terraform utility module that can clone an AVM repository from GitHub and push it to an existing Azure DevOps repo. But I face many issues and Im not able to debug.
Here is the file ...
4
votes
1
answer
128
views
What is the difference between running Node.js program from file and from terminal?
I was experimenting with this code using node a.js command:
console.log(this); // {}
(function func() {
console.log(this); // Object [global]
})();
and:
'use strict';
console.log(this); // {}
(...
2
votes
1
answer
84
views
Capturing rowcount from invoke-sqlcmd
I am using invoke-sqlcmd to pass queries to SQL Server and I would like to see the messages printed in the messages window of SSMS. When I do an insert from SSMS if successful I will see a message in ...
3
votes
1
answer
86
views
How is 'prompt' treated internally, especially with regard to the question mark variable ($?)?
(I'm a beginner in many aspects, so I apologize if I misuse some terminology.)
If a function runs with a non-terminating error (e.g. {Write-Error "error"}, or simply {a}), $? will be False ...