Category "powershell"

Using backticks to escape characters in sed with PowerShell running on Windows

I'm aware that, in PowerShell, backticks(`) are used to escape characters instead of the backslash(\). Hence, when using sed, this: echo '"where am I"' | sed "s

Save changes in ms access file

$path = “C:\path\myfile.mdb” $cn = new-object -comobject ADODB.Connection $rs = new-object -comobject ADODB.Recordset Opening connection to the Dat

How can I force Powershell to return an array when a call only returns one object?

I'm using Powershell to set up IIS bindings on a web server, and having a problem with the following code: $serverIps = gwmi Win32_NetworkAdapterConfiguration

Renaming Multiple Printers "Rename-Printer"

Having trouble with trying to import a .csv or .txt with multiple printer names (shown below). Running this locally on a server to change printer names in a lis

Why I cannot authenticate an app in Azure

I am trying to authenticate app in azure, but getting the following error, Response status code does not indicate success: 401 (Unauthorized). Authentication

How do you make a foreach create multiple variables?

I'm trying to make a script that will check a bitlocker encryption percentage and set it as a variable but for each drive. For example. I run my script that wil

How to destroy resources created using terraform in azure devops pipeline by using PowerShell

I have a project where I'm using Terraform in Azure DevOps Pipeline create Infrastructure but want to destroy the infrastructure in a PowerShell script running

Run VS code projects through batch file

I have so many projects I have to open during windows startup. So I have created batch file to open them in vs code as following. start cmd /C code C:\project1

Is there a way to make sure formatted string is always in quotations?

I am working on a new tool to help automate some tedious processes. it involves ExchangeOnlineManagement, Python, and Powershell. I have input variables that I

Powershell to change RDWEB certificates remotely

About to give up on this and connect locally to each system and run the commands but thought it wise to ask the smart people first. With my credentials locally

How to require a dll inside .psd1 for a .psm1 that is being invoked from a .ps1?

I read a lot of the answers here and I can't seem to find what I am looking for. So please bear with me. Each psm1 is a class. I have: Main.ps1 Modules/module01

Subprocess $Env:Path python: The filename, directory name, or volume label syntax is incorrect

I am trying to change the windows environment variables, but I am having trouble doing so. Before I tried to use os.environ() I tried out using powershell comma

Use PowerShell module in ARM deployment script

I have an ARM template in which I wish to execute a powershell script. In this question it is hinted that it should be possible to install powershell modules in

Best way to call and access powershell script in ASP.NET Core project

I have a PowerShell script which I have to call in an ASP.NET Core Web API solution. What is the best way to use the PowerShell script in an ASP.NET Cre Web API

How can I get a variable valued current working directory (pwd) in powershell profile

I was trying to use anaconda as my Python virtual environment, and my virtual environment is stored in project directory. Manually, I need to use following comm

ImportPSModule RequiredVersion is ignored

I'm trying to import a specific version of a PowerShell module. I have to do it from .NET. However, the RequiredVersion is simply ignored. Even if I use a non-e

Powershell batch renaming files with index

for a personal project I want to prefix folder and file names with an index. The goal is to have every childitem name remain the same except for the prefix. My

Graph API - Temporary Access Pass Generation

Have the following script that is trying to create a csv of TAP codes using the Graph API. Currently getting an Error 401 Unathorised error when reaching Invoke

Calling Azure Automation runbook from ADF Webhook activity - Fails with "Cannot bind argument to parameter 'InputObject' because it is null."

we are trying to call an Azure Automation Runbook from a Webhook activity in a Azure Data Factory pipeline. We work from the instructions provided in this blogp

How to Extract the variable values from terraform variables.tf file using PowerShell commands

I have a variables.tf file which contains all the project variables and im trying to fetch a variable values using PowerShell. variables.tf variable "products"