Category "powershell"

How to import multiple vCard VCF contact files into Outlook using Powershell?

How can I import multiple vCard VCF contact files into Outlook using Powershell ? My script for create vcf is : # Création d'un fichier.vcf New-I

Is there a way to make a PowerShell script work by double clicking a .ps1 file?

I am distributing a PowerShell script to my team. The script is to fetch an IP address from the Vsphere client, make an mstsc connection, and log it in a shared

Error while configuring conda activate on powershell using "conda init"

I tried to use the command conda activate It threw me an error: CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'. If u

How do I use Join-Path to combine more than two strings into a file path?

If I want to combine two strings into a file path, I use Join-Path like this: $path = Join-Path C: "Program Files" Write-Host $path That prints "C:\Program F

How to check if file is being used by another process - Powershell

I am trying to find a solution which will check whether a file is being used by another process. I don't want to read the contents of the file, as on a 7GB docu

No operation command

With Bash, you have the command : Null command. No effect; the command does nothing. Exit Status: Always succeeds. Example : 'foo' Does PowerShell have

Need to remotely open Chrome Settings Help in foreground using PowerShell

I have a requirement to run a script everyday and automatically update "Chrome Browser" if a new version is released. I am using a PowerShell script that goes l

Using Invoke-Command -ScriptBlock on a function with arguments

I'm writing a PowerShell script that will execute commands on a remote host using Invoke-Command and its -ScriptBlock parameter. For example, function Foo {

Using Invoke-Command -ScriptBlock on a function with arguments

I'm writing a PowerShell script that will execute commands on a remote host using Invoke-Command and its -ScriptBlock parameter. For example, function Foo {

ps1 cannot be loaded because running scripts is disabled on this system

I try to run powershell script from c#. First i set the ExecutionPolicy to Unrestricted and the script is running now from PowerShell ISE. Now this is c# my c

Read text file and run a copy command for each line in the text file

I am trying to write a Powershell script that will read a text file on my desktop that is filled with user names, then go out to a specified folder on our netwo

Which cmdlet to use for creating a domain (folder) under a Primary Zone on the DNS-server?

As the below picture shows, I want to use a PowerShell cmdlet to create/delete domains (folders) under a primary zone in the Windows DNS Server. I've have not b

Get associated security group for each folder?

I am using the powershell code below to get a list of folders and subfolders on a network share. Is it possible to also display the associated security group wi

Max size of ScriptBlock / InitializationScript for Start-Job in PowerShell

When you start a new job with Start-Job, you can pass it a ScriptBlock and a InitializationScript for example: Function FOO { Write-Host "HEY" } Start-Job -

tsc.ps1 cannot be loaded because running scripts is disabled on this system

On PowerShell, I got the error message when executing tsc. This never happened before. I am not sure should I mingle with the PowerShell security settings to r

PowerShell cmdlet to apply Password to Never Expire policy in M365 tenancy to all users (including current and new users)

I have run the following cmdlet in PowerShell to disable the Password Expiration policy in my M365 tenancy for all users. However, the cmdlet is not applied to

Is there a way to set a variable up to place output to stdout or null?

I would like to set up a variable in my code that would ultimately define if I'll see some output or not. "hello" writes to stdout "hello" > $null supresses

Loading Assemblies from NuGet Packages

Sometimes in my PowerShell scripts, I need access to a specific DLL, using Add-Type -AssemblyName. However, the DLLs I need aren't always on the machine or in t

Getting MSI Summary Information

i want to get the MSI Summary Information with PowerShell i found several scripts and code snippets for opening the "normal" Tables of MSI. So here is my questi

Why powershell does not run Angular commands?

I have started to learn Angular but I note that powershell in Windows gives me an error whenever I make an angular command like: ng new new-app or ng serve