PowerShell.org Forums
896 FOLLOWERS
PowerShell.org is a collection of online and in-person resources for the global PowerShell community.
PowerShell.org Forums
3y ago
Hi, the PowerShell forums has moved to https://forums.powershell.org , Apologies as for some reason the redirection is not working.
Please post the query on the new site ..read more
PowerShell.org Forums
3y ago
Hi, the PowerShell forums has moved to https://forums.powershell.org , Apologies as for some reason the redirection is not working.
Please post the query on the new site ..read more
PowerShell.org Forums
3y ago
Hello,
I wrote a utility that monitor a UPS. It is at https://www.github.com/chribonn/UPSMonitor.
If I type UPSMonitor -help only the first few lines of the Description come up.
Is this intentional or am I doing something wrong?
Thanks ..read more
PowerShell.org Forums
3y ago
Group-Object is a great option for this.
PowerShell
Import-Csv file.csv | Group-Object Item,Color | Foreach-Object { [pscustomobject]@{ Quantity = ($_.Group.Quantity | Measure -Sum).Sum Item = $_.Group[0].Item Color = $_.Group[0].Color } }
1
2
3
4
5
6
7
8
Import-Csv file.csv | Group-Object Item,Color |
Foreach-Object {
[pscustomobject]@{
Quantity = ($_.Group.Quantity | Measure -Sum).Sum
  ..read more
PowerShell.org Forums
3y ago
I re-posted my question on the other site. I didn’t really understand how your comment would help achieve what I am trying to do.
-Kevin ..read more
PowerShell.org Forums
3y ago
Your account and posts have been migrated.
Click the Log In button
Click the I forgot my password link and enter your username or registered e-mail address. This will give you a password for the new forum.
Visual guide:
https://forums.powershell.org/t/welcome-to-the-new-powershell-forums/7 ..read more
PowerShell.org Forums
3y ago
Hi, how to post https://forums.powershell.org/? Should i need to sign up ..read more
PowerShell.org Forums
3y ago
You can try it with Group-Object
PowerShell
$list = import-csv C:\Temp\test.csv # the Source of the Data $props = "Item", "Color" # the "group-filter" $list | Group-Object -Property $props # group the source with the "group-filter"
1
2
3
$list = import-csv C:\Temp\test.csv # the Source of the Data
$props = "Item", "Color" # the "group-filter"
$list | Group-Object -Property $props # group the source with the "grou ..read more
PowerShell.org Forums
3y ago
Please repost your question on the new forums at https://forums.powershell.org ..read more
PowerShell.org Forums
3y ago
Please use the new forums at https://forums.powershell.org
You have two commands on one line. A variable declaration, $FinalResult = @() and a foreach command foreach ($Name in $NameList).
You need to move the foreach ($Name in $NameList)to line 3 ..read more