Skip to main content

Questions tagged [powershell]

PowerShell is a cross-platform command line and scripting utility from Microsoft. Use this tag for questions about writing and executing PowerShell scripts ONLY. Programming questions specific to the cross-platform version PowerShell Core (Windows, macOS, and Linux) should be tagged [powershell-core]. Questions about system administration should be asked on Super User or Server Fault.

0 votes
3 answers
30 views

Getting error while trying to disable Azure DevOps pipeline using Powershell

I am trying to disable a build pipeline on Azure DevOps using Powershell but getting an error Script: $project = "<Project-Name>" $organization = "<Org-Name>" $pat = &...
Mudit Balooja's user avatar
1 vote
1 answer
58 views

How to loop through all video files (kind:video) regardless of what extension those files(could be .mkv / .mp4 / .mov etc.) have?

So I know that by using this command we can loop through all the MKV / MP4 files in the current folder. But I don't want to have to Google and find out what all possible file-types or extensions the ...
Vicky Dev's user avatar
  • 2,107
1 vote
1 answer
34 views

How to tee output from a command so only the last 1000 lines are saved in powershell

How to tee output from a command/App so only the last 1000 lines are saved in a file with Powershell but everything else is shown in the terminal
user2304458's user avatar
0 votes
0 answers
30 views

Find files in folder with specific size, attach files to email

I am trying to create script which will check source folder if it is empty and if it matches size. Then it will find files with specific string in those folders and then it will send those files to ...
Tomas's user avatar
  • 5
0 votes
1 answer
14 views

How to read all certificates one file is signed with?

I was looking for a Powershell script to read all certificates one file is signed with. Powershell itself allows only reading the first certificate of a file via the default command. See my solution ...
Carsten's user avatar
  • 1,959
0 votes
0 answers
25 views

PowerShell Start-Process in Invoke Command doesn't work correctly [duplicate]

I have a problem with PowerShell. Main goal is to run an exe (developed by me) on a remote machine. start-process in Invoke the command run related an exe. But its closed immediately by something. It ...
HLTECH's user avatar
  • 13
0 votes
0 answers
25 views

How can i get the Value property of a response from Powershell? [duplicate]

I make a REST call using Powershell and get a response of the following: { "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryRoles", "value": [ ...
Jenny's user avatar
  • 11
0 votes
1 answer
35 views

Name resolution fails within script, but works as singular command

I'm really confused here. Here's my script. If this script finds 3 machines (for example), I'll get an error that test-netconnection failed to resolve the name on two of them and one will work. If for ...
Roman's user avatar
  • 436
1 vote
0 answers
17 views

cmdkey not working when executed using a powershell deployed via GPO at logon [closed]

I'm attempting to deploy a PowerShell script that deletes generic Windows credentials using a GPO set to run at logon. The user has all necessary privileges. However, the script isn't working as ...
Amir Brs's user avatar
1 vote
1 answer
38 views

VSCode Invisible Breakpoint?

When working in visual studio code...I've noticed that some files will always break into them when you're trying to step over them (this is a GIF by the way...click on it to see what I'm talking about ...
Scott Newman's user avatar
1 vote
1 answer
33 views

How to use one PS dataset in a WHERE-OBJECT of another dataset

I have been using PS for about 10 years. Today I am stuck with finding a solution to a problem where I want to have items used in a WHERE-Object loaded from a SQL table. From what I have read, I need ...
veeduber's user avatar
0 votes
0 answers
30 views

Running Powershell script using local and Domain Admin credentials

I'm trying to build a script that requires entering admin credentials only once, and runs commands as admin, some of them as the logged on local user. I don't want to enter multiple credentials when ...
Jeremy's user avatar
  • 11
0 votes
0 answers
15 views

Git Alias for Powershell Profile Does Not Work [duplicate]

Git commands work on my Powershell and I've verified that my environment variables on Path for Git are correct. My profile looks like this: oh-my-posh init pwsh --config 'https://raw.githubusercontent....
BobDidley's user avatar
  • 123
1 vote
0 answers
25 views

PowerShell cmdlet Get-Team -NumberOfThreads

My question concerns the management of teams in MS Teams: I want to use Get-Team in PowerShell to retrieve all teams in my environment. Can someone explain to me what the -NumberOfThreads attribute ...
Moritz's user avatar
  • 11
0 votes
1 answer
39 views

Get-MgGroupMember by display name instead of userID

I am currently in the process of replacing an old script that used Exchange Online Powershell. The old script was very simple and only performed 2 tasks. Downloaded user photos that had custom ...
Qwenton's user avatar

15 30 50 per page
1
2 3 4 5
7868