Questions tagged [powershell]
PowerShell is a cross-platform command line and scripting utility from Microsoft. Use this tag for questions about writing and executing PowerShell scripts ONLY. Programming questions specific to the cross-platform version PowerShell Core (Windows, macOS, and Linux) should be tagged [powershell-core]. Questions about system administration should be asked on Super User or Server Fault.
powershell
118,146
questions
0
votes
1
answer
61
views
I cannot extract .sql CREATE TABLEs for each table in my Azure SQL Database in my Azure Repo
Like the question says, how can I do that? This is the script I am currently using through the generation of a .dacpac file, but I've seen that this can be done with a PowerShell script instead of ...
0
votes
0
answers
13
views
Unable to Export Server Certificate with Powershell
When attempting to set up an automated process to update the Octopus Deploy Certificate library with new certificates from our Servers. We are running in the following error message when trying to ...
0
votes
0
answers
11
views
chaining execution in powershell and premature exit with non-zero code, kills vscode terminal
In vscode terminal (powershell), I was doing the following:
& .\run-prog1.ps1 ; if($EXIT_CODE -ne 0) {echo "###failed"; exit 1; }; & .\run-prog2.ps1
In this case, run-prog1.ps1 ...
0
votes
0
answers
35
views
Why does csv consider data in one column to be an empty string
I have a powershell script, which basically takes an xlsx file with data, converts it to csv and then fills certain cells in another (template) xlsx file with values from certain columns. There are ...
0
votes
0
answers
18
views
How to get webViewLink of a file stored in my computer by Google Drive using PowerShell?
I would like to create a list of all files in a folder with its name and the webViewLink taken from the files sync'ed by Google Drive. I can get webViewLink for a particular file if I right click and ...
-1
votes
0
answers
53
views
Issue with Converting .ps1 Script to EXE [duplicate]
I am using the PS2EXE script from GitHub, and I am having an issue with my program after it's converted.
I have already done this with a previous program, and it worked fine, but this second program ...
0
votes
0
answers
54
views
Getting 401 Unauthorized error when attempting to POST to ASP.NET with Powershell
With the recent shenanigans of Crowd Strike, we have developed a tool to automatically unlock bitlocker-protected drives using a live USB. We have two MBAM servers, a production server and one server ...
0
votes
1
answer
39
views
Powershell - flatten out array with multiple values in multiple subarrays
When I run the API call below, I get the following result as a single line array.
service : Test-Change
name : svrtest
resource : server:domain:...
0
votes
1
answer
33
views
Writing a powershell script to create a report that uses custom object and putting it all together
I am attempting to write a powershell script, I have made a start and I can see that the script is pulling back some data. However this is where i am stuck.
the script so far looks like this.
foreach (...
0
votes
1
answer
32
views
Using data within a SQL table to build a WHERE-Object condition
I have been using PS for about 8-9 years. I want to use a SQL table to store a list of values to use in an exclusion WHERE Object clause. The source data is NOT in SQL. It is coming from a data set ...
1
vote
2
answers
23
views
I get wrong process id number after launch brave profile with Start-Process
I want to open some brave profiles and close them later. So I want to save process id's on a file and iterate them to close it. But Id returned from Start-Process is not a real Id and I can't find ...
0
votes
0
answers
8
views
Closing all Brave Profile Windows on a Virtual Desktop using Power Shell
I have multiple Brave profiles opened on Windows. I'm using virtual desktops and I have 4 profiles that I always open on the 'Developer' desktop. Let's say profiles number 2 to 6.
I have create a ...
0
votes
0
answers
19
views
Powershell script to uninstall a software when running via SCCM does not identify the registry keys of that software
I'm trying to uninstall a software using this code
$path = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{Product-cod-1}"
function Uninstall_SW {
Write-Host "Starting ...
1
vote
1
answer
41
views
Kill process based upon process Id powershell - xaml listview
I have a xaml listview with a button. The listview shows all processes that have powershell* or pwsh* in them. I want to be able to kill any of the processes by clicking a button but so far nothing I'...
0
votes
1
answer
22
views
WIX How to execute custom action that runs installed file with admin priveleges
In a Windows Installer msi package, created with WIX, I want to execute a custom action (written in c#) that executes a powershell script file that is installed by the installer.
The script needs ...