Category "powershell"

How do I connect the commands

So, this is my first script ever and I'm not an programmer. Infact, im an 15 year old student, so dont expect much from me, but I need to write a script to crea

Run new instance of CMD in PowerShell without a long string of text

So i was wondering if there was a way to remove all of the "&" when you're running an instance of cmd with arguments through PowerShell For example: start-p

Copy the file with folder structure from Linux to Windows using WinSCP and delete file which ever is copied and keep the folder

PowerShell or WinSCP – need to download the file and folder structure and delete the file which ever is copied and delete the file but not folder structur

Azure AD Updating Bulk users from CSV

I am new to this so please apologise if I missed some information. I have the following situation: I have a employee list in CSV and I need to update existing u

How to apply Excel Table Style using Powershell

I'm thinking about writing script that convert my existing CSV file to XLSX file so I been following this post https://code.adonline.id.au/csv-to-xlsx-powershel

Selection of only one user from list

I have this script that I need to use to retrieve the data of a particular user "ADTuser" from a list of servers the script works well, but the output file wit

Newbie powershell argument issues

I made powershell script that [1] accepts 2 arguments (aka parameters), [2] changes a file's modified date & time, and [3] writes something to host. The fo

$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?