All Questions
123 questions
1
vote
1
answer
61
views
Powershell Object to json array , mimic a Table/CSV
Given any PS object, that might have different number of properties. I need to create a json array of each property values, where the 1st row, would be the name of each property, and subsequent rows ...
1
vote
1
answer
73
views
Extracting value from nested object
I'm attempting to extract a particular value from a nested JSON response in PowerShell.
I am performing a GET method on a REST endpoint and getting the following back.
{
"value": [
{
...
0
votes
1
answer
38
views
Powershell: Create valid json file from object in array
I get all group names and the names of the "managedBy" field from AD. I want that output to export to an valid json file.
But my json isn't in a valid format, the brackets ([]) and the comma ...
0
votes
0
answers
26
views
How to convert a changing text file to json with correct formatting. Data will displayed as a HTML
I have a PowerShell script that prints out the following information as a text file.
I converted that text file as a json file which I Can index however, the goal is to convert this data into a HTML ...
0
votes
1
answer
64
views
Working with Powershell Arrays,HashTables, and JSON
I'm currently working on a project developing PowerShell commands to administer a device my company makes. The device responds to all sorts of different APIs for all its functions.
I'm currently ...
0
votes
2
answers
67
views
Build an array with powershell from json file
I have a json file that I would like to export or convert in csv or table format
My json source file is like this :
[
{
"host_display_name" : "DCWKS10",
"...
0
votes
0
answers
36
views
Powershell-organize an array of json data into a csv using the below code, however I'm unsure to make it into the right format that I'm looking
I'm trying to organize an array of Json data into a csv using the following code, but I'm still unsure of how to make it into the correct structure that I was seeking below.
$response = Invoke-...
3
votes
2
answers
195
views
Powershell ConvertFrom-Json unexpectedly produces a string instead of object array from single item array containing a string
File "array.json": ["bogus"]
PS C:\Users\Me> (Get-Content "array.json" | ConvertFrom-Json -NoEnumerate).GetType()
IsPublic IsSerial Name ...
0
votes
1
answer
195
views
Powershell: Issues converting curl GET response to array
I'm unable to convert a GET response received with curl in Powershell to an array using ConvertFrom-Json. The request is pulling a list of users from a webapp. A couple JSON validators say the JSON is ...
0
votes
1
answer
51
views
Interating to get the JSON name and its values using Powershell
Need help with how I can explicitly list the key names and its values for the below JSON using powershell.
{
"Data": {
"OS_Support": {
"SupportedOS&...
-1
votes
1
answer
64
views
how to declare Powershell parameter
I have a Powershell function where I am trying to declare some parameter $vipstatus, I mean when I try to execute the function with that parameter I want to see only the result stored in $vipstatus.
...
-2
votes
2
answers
343
views
How to store the powershell pscustomobject output in a single variable
I have a script, where I get my output using pscustom object (the one with the value -eq 0.0) but is there a way to join $netscaler name+$cmponentname+$name in a single variable ?
$Components = @(&...
5
votes
2
answers
190
views
How to force array with one element to generate square brackets in json
I'm trying to create a JSON array using:
$bodyObject = @(
@{
'Username' = '[email protected]'
}
)
$body = $bodyObject | ConvertTo-Json
But the $body object doesn't contain ...
1
vote
1
answer
68
views
ConvertTo-Json ignores array in the inner object
I have an object I need to extend. The issue is after converting to JSON the inner array object is always empty. I don't understand where's my fail :(
$settings = @{}
# create the nested object
$...
0
votes
1
answer
55
views
How can I convert a JSON variable into an array for use in a PowerShell script?
I have a JSON variable which i'd like to put into an array soni can use it in a powershell script
{
"Id": 118,
"downloadid": 91,
"Filter": {
"Searchterm": ...