All Questions
Tagged with powershell arrays
2,189 questions
0
votes
1
answer
49
views
Converting two property values from byte to string in a result array in powershell
I see a lot of questions and answer regarding converting a byte array into string however my case is quite different and I cannot for the life of me find a way to do what I need.
I generate a result ...
1
vote
1
answer
52
views
Powershell: Array of Buttons with Link
How can I assign a link to each button? I can't manged it...
I dont speak english well. Sorry for the translation...
$ButtonName =@('Option One', 'Option Two', 'Option Three')
$i = 0
$ButtonName |
...
1
vote
2
answers
85
views
Why does this multidimension array output as list?
A list
$tags = 'a','b','c','d','e'
the process
$array = New-Object 'object[,]' 3,5
$array[0,0] = $tags[0]
$array[0,1] = $tags[1]
$array[0,2] = $tags[2]
$array[0,3] = $tags[3]
$...
1
vote
0
answers
46
views
Powershell special treatment of @args [duplicate]
I am experiencing very odd behavior. It seems the $args/@args variable in powershell is getting special treatment and I don't understand why.
If you construct an object with the same exact types and ...
0
votes
0
answers
32
views
combine variable array of properties into a comma separated list powershell [duplicate]
I have a powershell command that pulls a list of devices with PRT in the name to a variable & am then trying to format the list in an easy to read output
$PrinterList = @(Get-WmiObject ...
0
votes
1
answer
78
views
Parsing a multi-line YML array into a loop
I've been scouring the web to help point me in the right direction but to no avail.
I'm trying to take multi-line array from one YML file and parse the values into a different ansible playbook:
...
0
votes
1
answer
68
views
Powershell array objects type being changed to string after using .Replace(), unable to compare to another array, which also claims to contain strings
I am currently working with Exchange Online and Graph to update my company's distribution groups.
The issue I'm encountering is when dealing with external users in my environment. When I am initially ...
1
vote
1
answer
44
views
Questionable output while iterating over an array of arrays
I'm building an array of arrays in Powershell with the goal of iterating over that array and outputting strings from each member element. However in doing so, I'm getting fragments that aren't making ...
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 ...
2
votes
2
answers
64
views
Is there a meaningful difference in this '@()' construction or is this a bug?
I have a function whose name parameter I want to provide tab completion for, the tab completion values are file names found in c:\temp. On top of using the files in c:\temp as values, I also want to ...
0
votes
1
answer
92
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 ...
1
vote
1
answer
45
views
Powershell split every string in an array
So, I have no seen anything remotely helpful on google or SO about this.
I have an array of strings and I want to run -split on each string in the array and end up with an array containing arrays of ...
1
vote
1
answer
50
views
PowerShell 2 different arrays
I have an $array1 that is docker containers and image names.
$array2 is a list of active pull requests from Azure Devops.
I have attempted numerous variation of the code below.
I cannot seem to figure ...
0
votes
3
answers
91
views
Pull specific data from text files in PowerShell with search parameters
We are trying to Pull AP name, bss, and ess values out of text files provided by a network team, in PowerShell 5.1. We have numerous files to go through and multiple AP Targets in each file.
Here's ...
0
votes
1
answer
57
views
Adding elements into an array using Powershell
I have created an array to store elements of Ids of a Get-Process request.
$arr = [int64[]]::new(1000);
Here is the code to output the data
$process = Get-Process | Where-Object {$_.handles -gt 1000}
...