182 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
3
answers
138
views
How to pass object to a function in PowerShell
I am trying to save some date to a PSCustomObject in one function and pass that object to another function so I can access the objects properties and values. I am doing something incorrect as I can ...
4
votes
1
answer
104
views
Windows PowerShell parsing json - bracket vs dot
Using Windows PowerShell terminal for running a PS script.
I need to do (among the rest) some json file parsing. I ended up in a strange situation, here below posting a minimal example:
Json file:
{
...
2
votes
1
answer
61
views
Accessing PSCustomObject Properties After Return from Function in PowerShell
I am working on a HealthCheck script that will check if a specific application is installed and verify the version number of the app, and verify id the service for that app is running. For testing ...
4
votes
1
answer
105
views
How can I output a PSCustomObject from a compiled Cmdlet?
I have a compiled Cmdlet that works with Hashtables. I would like to write a [pscustomobject] of the hashtable to the pipeline. In a PowerShell script block that would be accomplished using the ...
0
votes
1
answer
146
views
Sort an array of PSCustomObject by values of a property
I need help for my sorting issue with Powershell. What I want is simple, but I'm unable to find a solution.
I do have in Powershell an array @() of PSCustomObjects like code below. First I fill the ...
0
votes
1
answer
50
views
Join two PowerShell Queries into one PSCustomObject Table
I have this PSCustomObject:
$deviceList = Get-CimInstance -ClassName Win32_PnPEntity | Select-Object Name, HardwareID
$pnpDevLs = Get-PnpDevice | Select Object Name, InstanceID
# Loop structure ...
2
votes
3
answers
136
views
Iterating Json attributes and PSCustom Objects
I am looking into iterating json attributes and values from a json file w/out prior knowledge of the schema. I have code that works with many of the json files or downloads I have tested, but draw ...
0
votes
0
answers
38
views
Providing ps1 script an object returned from GET Request
first question here,
Im trying to use Powershell (more of a Mac user) to preform a repetitive task,
and I'd like to register the task to TaskSchedular using another script and the New-ScheduledTask ...
1
vote
2
answers
420
views
Powershell Sort-Object is not sorting a PSCustomObject if explicitly casting the column to [double]
Edit: I've updated the code sample to remove confusing pseudocode and added a few comments in the code.
I apologize for the long code sample. I tried to include pertinent information while cutting ...
0
votes
0
answers
46
views
PowerShell pscustomobject with inputs of varying number of values
I haven't figured out how to ask this question in a way to get the answer on my own. I am dealing with multiple data sources that I am trying to pull specific pieces of data from. List A ($invantroy) ...
2
votes
2
answers
85
views
Adding additional values to property of a PSCustomObject
I have three objects created that contain data from a parsed Json file.
#Get list of synthetic monitors by name
$executedMonitors = $json.result.data.dimensionMap."dt.entity.synthetic_test.name&...
1
vote
2
answers
39
views
Create Grouped Averages from CSV data using Powershell
I have a CSV file similar to this:
Name,Dates,Sortino,RoMDD,PctWins
AAL,2017年06月01日 - 2018年06月01日,-0.47,-0.26,66.67%
AAL,2017年09月01日 - 2018年06月01日,0.03,0.02,66.67%
AAL,2017年12月01日 - 2018年06月01日,-1.05,-0.69,...
1
vote
1
answer
39
views
Create an array of pscustomobjects which include a hasthable for export
I create a custom object
$ToExport = [pscustomobject]@{
"samAccountName" = ''
"forwarded" = @{
"ForwardTo" = ""
...
1
vote
1
answer
138
views
Export PSCustomObject containing HashTable to CSV
My Object is Structured like this
$ToExport = [pscustomobject]@{
"samAccountName" = ''
"forwarded" = @{
"ForwardTo" = ""
...
0
votes
1
answer
127
views
Add Objects in the right context to "pscustomobject"-Output [Powershell]
The following script generates a report with the following output objects "Role", "ResourceRole ObjectID" and "Target ObjectID"
#Install-Module Microsoft.Graph.Beta
...