Category "powershell"

Running Powershell script in Jenkins Declarative pipeline

I want to run Powershell script on agent from Jenkins declarative pipeline. It hangs on the script execution step (click on Job logs) and i have to forcefully e

In powershell, how can I define all env vars for the next command similar to python's Popen abilities?

In powershell, how can I... explicitly define all the env vars for the next command? I don't want any system env vars if possible, After this command runs I don

How to run a specific task in a powershell only in vscode

I am on windows 10 and my default shell in vscode is git bash which is used by all tasks. For a specific task, I want to use powershell. Is this possible

Export Vnet | Subnet

I'd like to export something like the view of the subnets that exist in a VNET like is displayed in the portal. Unfortunately there isn't an option to export th

How to install GroupPolicy module for PowerShell?

I just started writing scripts in PowerShell. The desired script is supposed to create a local GroupPolicyObject (GPO) which will be specified afterwards. Resea

How to use an environment variable in PowerShell console?

I have an environment variable named GOPATH. In old style command shell I could run the command %GOPATH%\bin\hello like this: Is there an equivalently simple c

Do we need Active Directory Domain Controller to run any PowerShell commands?

I am trying to run a Powershell script which calls Get-ADUser command. Something similar to this question Powershell Active Directory commands not working in Po

Running C++ exe file in PowerShell

I'm usually not programming in C++, but this time I had to and I've got a problem executing my code in PowerShell (which I have never done before). The program

How to add Author to a windows task using powershell

I'm creating a window task using powershell, everthing is ok, but i can't find how to add the Author name. Register-ScheduledTask as a parameter for description

SSIS execute process task with powershell

I am trying to write files to Azure File Share using the unc path. The script runs as expected when run interactively. But, when run from the SSIS execute proce

How to install git on Windows 10 without Git Bash or GUI?

I am trying to install Git on Windows 10, but without Git Bash or GUI. I want to use Git in PowerShell and I would like not to bloat my PC. I know the install s

Find and replace with PowerShell based on the next line

I'm trying to find and replace via PowerShell based on what's on the next line of the line I want to replace. For example, the following text file: blahblah

Set NewMessageSignature with Powershell without using Word

So far, the only way I've found to change the default New Message Signature in Outlook is by instantiating Word: $MSWord = New-Object -COMObject word.applicatio

How can I get the Log directory?

I have recently installed SSAS on my servers and instead of going through 24 of them, I am writing a script to get back the logDir of the servers. I am trying

How to print UTF-8 (or unicode) characters in Go (golang) on Windows

Let's have a look at this: ✓ Hello, 世界 As you can see there is a unicode checkmark and chinese/japanese characters. In go, If I use MSYS

What does this PowerShell syntax mean?

In powershell what does the syntax $x = . { ... } mean? How is it different from $x = @( ... ) From what I can tell they both create an array of the provided va

How can I optimize this Powershell script, converting JSON to CSV?

I have a very large JSON Lines File with 4.000.000 Rows, and I need to convert several events from every row. The resulted CSV File contains 15.000.000 rows. Ho

Add-PnPEventReceiver only works fully when -UseWebLogin parameter is used

I'm using PnP Powershell to add an Event Receiver to a document library. The Event Receiver points to an Azure function. Below is code that I wrote in a local

How to check if SQLAlwaysON is existing in server using powershell without a SQL DBA Admin access?

I want to check if SQLAlwaysON exists in server. I already know that typing and getting the powershell commands Enable-SQLServerAlwaysON and Disabled-SQLServerA

Can I use splatting to pass arguments to a non-powershell executable?

Can I do something like this? $splatting_table = @{ "-parameter" = "value" "-parameter2" = "value2" } .\external-command.exe @splatting_table as an equ