In PowerShell, how do I convert DateTime to UNIX time?

PowerShell
In PowerShell, how can I convert string of DateTime to sum of seconds?
2 years ago

Sync-WDSite Web Application Physical Path Parameter

PowerShell
I've written a script which syncs sites between IIS Servers. All my website got synced without an error, but one site (which is of course the site whi...
2 years ago

Replace a character with new line

PowerShell
Powershell ver 4. Windows 7 I wanted to replace , with new lines in a text file. I tried below script (Get-Content C:\Test\test.txt).Replace(',','`n...
2 years ago

How to find MAX RAM in powershell

PowerShell
How to find the maximum RAM a computer can be extended upto in powershell. I tried using $colItems3 = get-wmiobject -class "Win32_OperatingSystem" ...
2 years ago

Creating log file in powershell

PowerShell
I have a powershell program that checks if the site is responding and retrieves data and put it inside a file using invoke-webrequest function. I want...
2 years ago

PowerShell foreach how to skip last element

PowerShell
I have the follow array with the elements $list = "A","B","C","1","2","3" using foreach I can view all items in the array. foreach ( $item in $...
2 years ago

How to add application to Azure AD programmatically?

PowerShell
I want to automate the creation of my application in Azure AD and get back the client id generated by Azure AD. Are there PowerShell commandlets to d...
2 years ago

Authentication error with webclient in powershell

PowerShell
I'm relatively new to Powershell so really not sure where to go with this issue now. I am trying to download a file from a subversion repository and...
2 years ago

Powershell : How to get Antivirus product details

PowerShell
We have over 1500 servers. Windows 2003, 2008 and 2012. I have to gather the details of antivirus(Product Name & Version) on these servers. There ...
2 years ago

Unable to sort a 2D array in powershell

PowerShell
I'm getting some unique results with this little guy clear $Datas = @{} $Datas["Database1"] = "440" $Datas["Database2"] = "140" $Datas["Database3"] =...
2 years ago

Script to get CPU Usage

PowerShell
I am using this script to get CPU usage from multiple server $Output = 'C:\temp\Result.txt' $ServerList = Get-Content 'C:\temp\Serverlist.txt' $CPUPe...
2 years ago

Powershell script that imports from CSV, checks AD account status, then exports to CSV

PowerShell
I am writing a Powershell script to take a CSV file of Active Directory accounts, validate each account, and write the validation status back to a sep...
2 years ago

Search and Organize Data through windows command line

PowerShell
I'm a newbie in windows scripting, so bear with me. I want to find "test" folder from multiple folders. Such as Search test folders from multiple pa...
2 years ago

(powershell) Select-String vs Findstr

PowerShell
This is very simple... why first command working and second no? Findstr looks to me for best use in "dos"like commands and not in powershell. Get-Ap...
2 years ago

deleting array content which matches with an other array

PowerShell
the goal of my script is to copy some files. i import a config file, which gives me the path and a filename for an exclude (the exclude shouldnt get c...
2 years ago

Powershell Clear-History doesn't Clear History

PowerShell
Recently I had to run a command that unfortunately required me to type a password right on the command line. Afterwards, I cleared my screen with "Cl...
2 years ago

Get only leaf nodes from Get-ChildItem

PowerShell
I would like to filter out only leaf nodes (folders) from Get-ChildItem, those ones that do not contain any other folders in them. Here is my current...
2 years ago

Using Variable in Remove-Item returns "A drive with the name '"E' does not exist"

PowerShell
I have been writing a script which searches for specific folders within an "Archive" folder and then zips them. Once the folder is successfully zipped...
2 years ago

Add child node at the beginning of XML

PowerShell
I am trying to add a child node in the following XML. I am able to, but my issue is it adds it at the end. How am I able to add the node at the beginn...
2 years ago

Get Content from file path

PowerShell
I have a script that will email a notification when a file exists. It takes a line of text from the file and emails it to the recipient. It works fin...
2 years ago