Category "powershell"

Return type PSObject not right

I have a situation regarding PSObject. Thing is when I write only the same PSObject in different script it returns what it should. $returnobject = New-Object -T

Print only non-blank lines in PowerShell

I have a text file with multiple lines. Many are blank, or so I am assuming from looking at the file contents. I would like to write/print only the lines that c

Delete old entries of the event-log with PowerShell or CMD? (Not all of them | With period of time condition)

Please take a look at these two threads : how-to-clear-eventlog-with-powershell-or-wevtutil delete-old-entries-of-the-event-log-with-powershell Some days ago so

Powershell : getting AD groups without members

I want to get AD groups with no members like below. How can I get this? My desired output: Group Name, Members Group01 , YES GRoup02 , NO Here is my script :

Windows10 connect network folder and find files with keyword in path

Newbie in windows command. I am trying to connect network folder in windows10 and find the most recent files(created in says past one day) with path includes sp

Powershell - how to check if installation is running in user or system context

I have packaged an application with the App Deployment Toolkit. I install the application with the command: Start-Process -FilePath $setupx64 -ArgumentList "/si

How to search through FSPs by sAMAccountName

Does someone know how you can search troughs FSPs by sAMAccountNames Get-ADObject -Filter {ObjectClass -eq "foreignSecurityPrincipal"} -Properties msds-prin

How to install themes for Oh My Posh in Powershell 5.1?

I use Powershell 5.1 daily in Windows Terminal. However, since a few days, my Oh My Posh theme stopped working, and printed an error that said it couldn't find

How to install themes for Oh My Posh in Powershell 5.1?

I use Powershell 5.1 daily in Windows Terminal. However, since a few days, my Oh My Posh theme stopped working, and printed an error that said it couldn't find

Getting a 'WS trust response'-error when executing Connect-PnPOnline in Powershell

Since I updated the Powershell Pnp-module to the latest version (1.10.0) I get the following error when trying to connect to PnpOnline: PS C:\Users\Admin> Co

Azure DevOps REST API, retrieve current environment status

We have a small development/testing environment setup on Azure VMs that only run during business hours. Sometimes one of our Devs may complete a PR after hours.

Azure DevOps REST API, retrieve current environment status

We have a small development/testing environment setup on Azure VMs that only run during business hours. Sometimes one of our Devs may complete a PR after hours.

Unable to Access SharePoint using PowerShell

I have registered an Application on Azure and I am trying to get an access token using the following command. $Auth=Get-ODAuthentication -ClientId 01xex4x7-f0e2

How to get/print the daily cap. of the app insights using azure powershell commands?

I tried the below commands but getting this error https://aka.ms/cli_ref Read more about the command in reference docs ERROR: argument --app/-a: expected one a

Powershell pagination with page token

I am trying to curl an API on loop while the page token is not empty. Essentially get all the results. I am having difficulties implementing the pagination. $he

Powershell 5.0 doesn't see PATH environment variables under User account

I added an environment variable to my System Path -> C:\Program Files\TEE-CLC. After that, I expect, that I can run my foo.exe which is under C:\Program File

Check if a value in a list exist in a column and if not, write the non existing value to the next column

I have a csv file containing metadata exported from a pst e.g from, to, cc, bcc. I have a list i can query: \*\*my list \*\* Wayne, John little, Joe I have mul

AzureAD Powershell cmdlets work locally but erroring in Azure DevOps Microsoft Hosted Agent with "Error reading JToken from JsonReader"

I have a powershell script that runs locally on my Windows Desktop running powershell 7.2.1. However when run on a Microsoft Hosted Windows-Latest agent in Azu

use Invoke-AzVMRunCommand -Params

I am trying to use the command like so: a = 345 name = "myVM" Invoke-AzVMRunCommand -ResourceGroupName $RGName -Name $VMName -CommandId 'RunPowerShellScript' -S

how to run powershell command from nushell

After installing nushell (https://www.nushell.sh/) in my windows environment, I want to use the power of nushell in conjunction with powershell. For example, I