Category "powershell"

DataGridView with SuggestAppend comboBox columns and dynamic Cell assignment

I have been doing some research and could not find an answer for this, probably I'm not asking the right question or what I'm attempting might not be possible.

getting Missing opening '(' after keyword error in ffmpeg loop command

How can I run this command that runs in Linux in Windows 10 powershell for ffmpeg? for file in D:\input\*.mkv; do ffmpeg -i "$file" -map 0:v:0 -map 0:a:0 -map 0

How to sort strings in a file numerically

In my batch script there will be a temporary file with the notes that are in a section (gotten from a json file but that doesn't matter) Format: (position of no

How to get a list of files into a Powershell array

I want to get a list of files into a Powershell variable that I can use in subsequent code. Files: file1.csv file2.csv $sourceFiles = Get-ChildItem .\file*.c

Powershell Color Schemes?

Is there a place where I can find Powershell Color Schemes that people have already built? Something like https://github.com/lysyi3m/osx-terminal-themes, but fo

Capture output from powershell without The PowerShell object

In my c# app there is some button, when the user clicks on this button the app runs a powershell script. a window of powershell pops out and the user see the r

Azure DevOps: How to retrieve a build artifact from build Azure Pipeline from a PowerShell Script in Release Pipeline?

I have a published a build artifact published to $(Build.ArtifactStagingDirectory)/drop with artifactName "some_sidebar" and the artifact publish location is Az

Exporting a result list onto an HTML email alert

I am trying to export the result of a powershell script. The idea is to export the result via email on Azure. The code snippet can be found below. Get-AzSqlServ

Trapping a PowerShell Statement from Win32_Process into a Variable for Taskkill Command

This powershell statement looks for a long commandline string from a process java.exe - it uses the string server1 to trap this specific process. It returns th

A better way to slice an array (or a list) in powershell

How can i export mails adresses in CSV files in a range of 30 users for each one. I have already try this $users = Get-ADUser -Filter * -Properties Mail

Call multiple .bat from another .bat without waiting for one to finish

So, I want to make a script that will execute 2 .bat files and start some .exe files. However, the .bat files are supposed to keep running. I have something l

Call multiple .bat from another .bat without waiting for one to finish

So, I want to make a script that will execute 2 .bat files and start some .exe files. However, the .bat files are supposed to keep running. I have something l

WSL, Running linux commands with "wsl --exec <cmd>" or "wsl -- <cmd>"

wsl -h shows the following: --exec, -e <CommandLine> Execute the specified command without using the default Linux shell. -- Pass the remainin

Is there a powershell pattern for if($?) { }

I find myself chaining these a lot, eg: do-cmd-one if($?) { do-cmd-two } ... then at the end: if(!$?) { exit 1 } I assume there's a pattern for this in

Powershell Creating Password Expiration Report

I am trying to create a password expiration report that runs once a week and I want to grab 7 days of it at a time. The current script that I have been creatin

Is anybody having this Powershell "Update-Help" command, issue?

I am trying to download and install Help files for all the commands but it won't work. I am using Powershell 7.1.1 inside the Windows Terminal. Update-Help: Fai

How can I use logical AND (&&) in Powershell?

In terminal I used to run two commands at once using '&&' operator. For example if I want to compile and run C source code I only need to write: gcc co

Powershell GUI auto generate buttons with functions

TLDR: How can I make a generated variable, and then call that variable later within a Add_click. I am sure some kind of serialization of each Object/button I ma

Retrieve Outlook info account from multi profile

I am working on an Outlook inventory powershel script (see also powershell calculated properties for multiple values) This code work great, but only with the d

How to enable "Allow Azure services and resources to access this server" through PowerShell (Azure CLI)?

After creating a new Azure SQL server using az sql server create, how can I enable the following options through PowerShell(Azure CLI)?