Category "powershell"

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)?

How to format output of Export-Excel in order to get colored header in PowerShell?

The code below is working fine to export data, but I need the header / first row to have custom background and text colors. I would like the header to be filled

How can I use pester v5 configuration or container with four standard arguments?

I'm trying to invoke a pester script, moving from pester V4.6.0 to V5.3.1 The V4 arguments I used to use, when invoking pester were: -supplying custom parameter

PowerShell Script to implement ipsec rule

I am troubleshooting an issue in our local IT infrastructure. Some time ago a GPO was pushed that blocked traffic from our IT administration program to our prod

Visual Studio Code Terminal keeps running Python script in Powershell

I recently installed both Python and Visual Studio Code. After taking an intro class I wrote a basic script and ran it in Visual Studio Code. That's when I no

Command to Redis Cluster healthcheck

Is there any windows PowerShell command to check Redis cluster healthcheck running on windows?

Cannot display emojis in Windows Powershell or WSL Linux Terminal using Python

I am trying to print emojis in both Windows Powershell and WSL Linux Terminal using Python3. I have tried using unicode, CLDR names and also installed the emoji

PowerShell script to SSH to Multiple Linux devices and restart/reboot them

I am comfortable with writing single queries. I am new to writing bash scripts trying to automate the daily stuff. I need help on creating a PowerShell or bash

How to make a filename by date with powershell

I'm pretty new to Powershell and would like to output the result of a command to a file name. I try the following within the powershell shell: $a = (Get-Date)

How to fix 'rimraf is not a recognized command' in Windows 10

After creating the .NET Core / React & Redux project template and attempting to start the application, the react compile crashes with rimraf not recognized.

How to modify the output of PowerShell Jobs if they take too long

I have a relatively long/complex script that blindly runs a batch of commands against several devices (as jobs). Once in awhile, a couple of these jobs continu