How to email a report on available Windows Updates
I have been using the module "PSWindowsUpdate" to automate updates on our client machines at specific times, however, now I have been asked to also have a report on which updates are available and...
View ArticlePowershell Scripting | Switch Statements
Hello! I'm a student and currently am taking powershell. We are finally doing scripting, and I have to make a rock paper scissors game. This is my first ever language, so sorry if I sound braindead....
View ArticlePowerShell Function form
Hello Techies, I have created a form using PowerShell script which contain credentials on top and at the bottom contains other components. now the credentials and other functions in the form is working...
View ArticleCopy a folder using Copy-Item
When first time run Copy-Item "\\server1\c$\apps\folder1" "\\server2\c$\apps\" -recurse -forcethe folder1 is copied in \\server2\c$\apps\When run the same script above again, the folder1 is copied in...
View ArticlePush json string into arraylist convert json element into string instead of...
$t=@() $r= new-object -type PSObject class { [string]$a [string[]]$b } $c =get-adgroupmember -recrisive $team| select SamAccountName $c.b = $c.SamAccountName $c.a="dummy" $t += $c $r | add-member -name...
View ArticleError When Running Upate-Help
Can anyone tell me why I am getting this error when I run the Update-Help command?PS C:\WINDOWS\system32> Update-help Update-help : Failed to update Help for the module(s) 'WindowsUpdateProvider'...
View Articleinvoke-webrequest with an internal sharepoint page
HiI am trying to capture the html of a page in sharepoint 2007 (Win 2008 r2 ) using powershell. I have tried the following code:$username=”ldelpo01$password=”yyy”$base64AuthInfo =...
View ArticleHV Cluster Hard Drive information
Hi,I'm new to Powershell, so please forgive me.I'm looking to find out which of the VMs in our HV Cluster have dynamically expanding hard drives. Is this possible through a PS script? I'd prefer not to...
View ArticleI need to append new JSON to an existing file
I have a JSON file $jsonfile= gc C:\Users\asif\data.jsonwrite-Host $jsonfile{ "buildDate": "2017-08-16", "version": "v1.2.0" }how do I append the below value to above?$jsonContent =...
View ArticleSort text file contents by date
Hi I have a text file that contains dates and data I need to sort the contents of the text file so with the most recent date being listed 1st /ordered from most recent downI would use get-content to...
View ArticleImport password protected PFX Cert into trusted root
Hello,I have to import a PFX Cert to:Cert:\LocalMachine\RootThis is my last try (and there were multible ones):$tempdir = Get-Location $tempdir = $tempdir.tostring() $certfile = $tempdir +"\xyz.pfx"...
View ArticlePowers hell - Folder sync (one way)
Hi Experts, I want to ensure ‘target folder’ in ‘Server 2’ has all the files from ‘source folder’ in ‘server 1’. However how do I ensure that if files get modified in ‘server 1’, they are updated on...
View ArticleBasics of 'Array'
Hi guys, I'm trying to understood to the powershell array. And i'm really confused.what is the different between: $a = 1,2,3,4$a = @(1,2,3,4) or $a = @{1,2,3,4} --> What is the different between...
View ArticleHow to find the count or the oldest mail in the mailbox, hosted on Exchange...
Hello Team,Can you refer me to some samples or code hints to find either the count of all mails or the oldest mail in the mailbox? The mailbox is hosted on Microsoft Exchange online.I tried the...
View Articlehow to create directory from csv file with " ForEach-Object {New-Item...
Hi Friends I need one help to create folder on home directory path of user profile TAB, I am using below script but when I try to pull homepath information from CSV file, it gives me error: But when I...
View ArticleHow to run a command from being in a directory in D drive in Powershell
I am trying to run a powershell command from below in section b. The Provisioning services console is in D:\ drive as the software is installed in D drive. But, I need to run the Citrix.PVS.snapin.dll...
View Article$a is equal $b - but ($a -eq $b) is false !!!!
Something about byValue or byReference??? or What is it a'm missing. What is happening - and why?$a="Test" $b="Test" $a -eq $b (True) $a= get-eventlog system -newest 1 $b= get-eventlog system -newest...
View ArticleSome Storage CMDLets do not work under WinPE
I have built a custom WinPE based on W2012 and included Powershell and a number of the Powershell CMDLets such as SMB, DISM, and Storage. Everything works fine. When you boot the WinPE disk and do a...
View ArticleUpdating Users Attributes with a csv file
I put the extension number of users in Telephone number field in Active Directory. Our extension was changed from 3 numbers to 4 numbers. How can I update the telephone number field for all users with...
View Articleinvoke Multiple powershell instances through PowerISE
I have multiple csvs in a folder that are name sequentially (e.g. 1 to 100). How is it possible to invoke multiple powershell child instances through PowerISE. Each of those child instances will read a...
View Article