Category "powershell"

Get date and time on the same line

I can use date /t and time /t to get the date and time, but it doesn't display it next to each other. I wanted to make it do that and display like this: Curren

How do I remove the cruft at the start of my posh-git window title?

I'm using posh-git for my powershell window, and the prompt is perfect: S:\Repos\DevTools [master ≡ +1 ~2 -0 !]> But the title of the window has ext

convert "Yes" or "No" to boolean

I want to parse user values contained in .CSV file. I don't want my users to enter "Yes" or "No" but instead enter "True" or "False". In each case I want to c

PowerShell Version check prior to script execution

I'm just asking the communitty if they have come across a way to have the a script check what version of POSH is running prior to the execution of the script.

How can I pull Mail Contact groups for each contact with powershell?

I am trying to create a script to pull contact groups and put them in an excel sheet. Here is what I have so far: Import-Module ActiveDirectory Get-ADUser -Sea

Datadog Agent installation on Windows

I am trying to install the Datadog agent on Windows using PowerShell only, not manual however, the APIKEY is not being setup. Is there a way to update/set the A

Get the last command executed on a PowerShell script

I'm updating the logging function I use for all my scripts and making it compatible with the SCCM logging viewer. Under the fields that the SCCM viewer takes i

Specifying complete installation option when running msi from powershell

I am trying to automate the installation of gstreamer on windows using powershell I have the msi file downloaded, and am installing it as shown below PS C:\User

Unable to connect to the server: dial tcp: lookup <Server Location>: no such host

I'm beginning to build out a kubernetes cluster for our applications. We are using Azure for cloud services, so my K8s cluster is built using AKS. The AKs clust

How to check if a DateTime value is not null or empty?

I want to check if the DateTime field is not an empty\null string. if datetime field is not null then I will do stuff. [DateTime]$expdate = Read-Host "Expirati

How to get item ID of the last modified item in the SharePoint online list using pnp powershell?

I am able to get the date of the last modified item in the list using the script below: $SiteURL="https://abc.sharepoint.com/sites/sitename" $ListName="Document

Is it possible to use with and endwith instructions?

I am translating vba code to PowerShell Does with and endwith exist in PowerShell? What is the alternative? Could you give me an example?

Download files from SFTP server using PowerShell

I need to download files from SFTP server to a local machine using a PowerShell script. The API/library that will be used for the download needs to be able to

How to access outlook object using powershell script without a security prompt?

I have prepared powershell script which access outlook to save the attachment and prepare the new report. Currently my script always ask/throws the pop up askin

Create show-menu in powershell depending on variables

I want to create a menu with show-menu that will depend on what is present on the computer. I want to list in the menu usernames available on c:\users\ (based

Powershell - Fastest way to write large body of text to a file

In terms of runtime performance, which is the fastest method in powershell to write a large body of text into a file?

Windows ISO 8601 timestamp

I need to convert a date in Windows PowerShell to the ISO 8601 format. In Linux/Unix it was no problem with TZ=0 date -d "<random-format>" +%Y-%m-

Outlook Distribution Lists (DistListItem) are not updated after a referenced contact (ContactItem) is changed

I've gathered some code from around the web to create Contacts and then Contact groups. However, if I update the contact after creation, the "relation" between

Allowing bookings of o365 room for external users

I have a O365 tenant with a bunch of resources (=rooms) in it, e.g. [email protected], and a few users, e.g. [email protected]. The rooms are possible to book for users

powershell command line parameter are executed in uppercase?

I would like to use a WGET command line program under Windows in a powershell script. example : wget https://domain-name/file_01.pdf -o wgetlog.txt Step 1 - E