Questions tagged [calculated-property]

A PowerShell feature for defining object properties dynamically, by way of hashtables defining the property name and code that calculates the property value based on the current pipeline input object.

See the conceptual about_Calculated_Properties help topic.

6 questions
1
vote
1 answer

Replace value in list with calculated property powershell

I have two lists in powershell that have the following structure: Variable = $serviceusage2 ServiceName ActivatedUsers Serivce1 24 Service2 4 Service3 10 Variable…
Jim842
  • 23
  • 2
1
vote
1 answer

How to use PS calculated properties to collate data into a cell?

I'm stumped on this one. I have a PS custom object with strings only and I want to build a report where I'm outputting strings of data into a new pipeline output object. $myObjectTable | Select-Object @{ n = "OldData"; e = { $_ |…
1
vote
3 answers

Powershell to output a list of records in a txt file

Running the following in powershell $files = Get-ChildItem -path "C:\temp" -Recurse -Include "*.csv" ForEach($BusinessFile in $BusinessFiles) { $bfiles = get-content $BusinessFile.fullname | Measure-Object -line $bRowsinFile = $bfiles.lines…
PshellUser
  • 27
  • 7
0
votes
1 answer

Powershell - PSCustomObject with Calculated Property

I'm importing a .csv file which I'm then modifying using calculated properties in a PSCustomObject. I'm stuck on one calculation where I'm attempting to lookup a value from a datarow object using one of the .csv values. We receive data with the…
ColinA
  • 99
  • 1
  • 9
0
votes
0 answers

Returning the sum of comma separated values based on a reference table

I'm creating a spreadsheet where I may have two values in the same cell seperated by commas, such as "Leadership, Activity on Campus". Both of these are worth two different amounts of points. I was trying to create a formula that would allow me to…
user20610702
0
votes
0 answers

What kind of powershell syntax is this?

Im working on a powershell file and im a bit confused because of the following syntax: what kind of syntax is this??? And where can I read more about it? Is "select" just an abbrevation for select-object?
Lumberjack
  • 419
  • 6
  • 12