Category "powershell"

$env:PATH different for Windows Powershell and VSCode integrated Powershell

I am using Windows 10. The result of $env:PATH is different for Windows Powershell and VSCode integrated Powershell. I need the VSCode integrated Powershell to

How to get the Version Number of Microsoft Office from its Build number in Powershell

I read on my Windows based systems (via Remote Powershell) what is installed on their computers. This creates a report. I am having some difficulties looking in

Powershell script to remove users from distribution groups

I'm trying to find a solution to remove a user from all the distribution groups they are in. I found this script but am running into issues: $email = Read-Host

powershell script to select directory

I would like to create a powershell function or cmdlet that would allow me to quickly navigate to files and function like the example below. Could someone enlig

performance issue in PowerShell 5.1

I have a powershell script that reads and parses a text file. The file is read into memory and then processed line by line. When I switched from Powershell 4.0

How to find all Confluence pages with PowerShell

I'm trying to pull all Confluence pages in my instance that haven't been modified since 1/1/21. I was able to get all of the parent pages that haven't been mod

How to update XML with reading it only once with PowerShell?

Can someone please help me to do the following more efficiently? I am running this code 4 times for updating specific below protocols/file types. I would like t

Set the UserPrincipalName to be the same as PrimarySMTPAddress?

I need to fix the below script where the goal is to set the UserprincipalName to the same as the ProxyAddress SMTP: (PrimarySMTP) entry. $paramGetADUser = @{

How to normalize and compare paths in Powershell

I need to test two strings, which contain paths, for wether they point to the same directory or not. Simply using a string comparison fails when comparing C:\Wi

Unable to run batch file from powershell script when it is a scheduled task

I am trying to run a batch file from a powershell script that is a scheduled task. The script sets up a filewatcher and in the action block it calls a batch fil

Powershell script to rename Files adding Last Modified date to name, script won't run in sub directories

I have an old server archived and would like to rename all the files by adding the last modified date to the file name. There are many layers of folders in the

What is the encoding of CompletedProcess.stdout coming from Powershell/Windows in Python?

I am getting this output from a ping request started from Python with subprocess.run(): >>> process.stdout b"\r\nEnvoi d'une requ\x88te 'ping' sur www.

How do I read a .env file from a .ps1 script?

I have a .env file like this one: TESTCASE_GROUP_SIZE=25 . . . And I want to get its value (read it) into a .ps1 script. How can I do it?

Exchange online - Copy mailbox permissions from one user to another

I'm Trying to find a way to copy a users mailbox permissions to another user, I can output the data I need in PS just can't find a way to then apply those permi

Powershell running .NET Core on Linux RedHat giving SSL error connecting

I am currently trying to use dotnetcore to run a script over Powershell. This script uses a library that will authenticate with Azure using a service principal

Batch script to delete Computer Objects from the ARS portal

I used the below script to delete bulk users from the ARS portal [Dell Active Roles] Connect-QADService -Proxy -Credential (Get-Credential) Import-Csv "C:\IT\D

Renaming localization of built-in Active Directory Groups using SID

I have a few site/domains that someone installed with a foreign language, hence the built in security groups are in localized language. It doesnt help adding a

Refresh a variable within a foreach statement

We have a master registry within our on premise SharePoint environment, to keep this list accurate, we run a clean up script each day to remove the item within

PowerShell AzureAD odata v3.0 filter

So I am trying to fetch all sign-in logs that fails a particular Conditional Access that have been set in Report-Only mode. The cmdlet is in preview and is unab

Automate publishing .NET Core App to multiple subdomains

I have a .NET Core application used by many clients. Each client has its own subdomain. Each client has its own database. All databases are identical. Different