Category "powershell"

powershell script to list all sub-folders in an Outlook Inbox

New powershell user here. I want a list of all folders and subfolders and subsubfolders etc. from an Outlook Inbox Add-Type -assembly "Microsoft.Office.Interop

Touch command not working in Terminal of VSC

I'm new and still trying to figure out how to configure my development environment. I'm getting an error when using the touch command in Visual Studio Code. I c

How to fix "running scripts is disabled on this system"?

When I try to run ionic commands like ionic serve in the terminal in VS Code, it gives the following error. How can I fix this? ionic : File C:\Users\Lakshan\Ap

Powershell taskkill /F /IM firefox.exe /T without killing the developer version with the same .exe name?

I've got a macro looping with powershell and at the end of a run to clean up it kills and restarts the browser, Standard FireFox version firefox.exe Using: task

Script path of PowerShell task Azure DevOps release

I have PowerShell script, that I would like to use in deployments of Dynamics 365 to migrate an Access Team Template to our Test and Prod environments. I have a

PowerShell - Need to test if item contained in a list

I have an object that holds a list of patches (actually 2 lists) One of the patches in the list contains the words "Cumulative Update" in his title so I run in

How to monitor for new evets in eventlog and trigger an action

I would like to know the logic or the piece of powershell code that can be used to monitor for a service shutdown event and trigger an action. So when the servi

Add new entries to the Windows Credentials Vault

I want to be able to add multiple entries to my Windows Credentials Vault using PowerShell. I searched a bit and came across this code: [Windows.Security.Creden

Powershell. Why where {} directive can not find two matching DeviceID? One taken from Win32_VideoController, another from Regedit value

Here is code # | Get DeviceID and Name of GPUs presented in system $GPU_Inf = Get-CIMInstance -Query "SELECT Caption, PNPDeviceID from Win32_VideoController" #

open HTML from PowerShell with URL parameters

I am trying to open a HTML file in Microsoft Edge browser from PowerShell. Below code opens HTML in Microsoft edge &'C:\Program Files (x86)\Microsoft\Edge\A

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