Adding a comma force to create an array:
$x = @(
,@(1,2,3)
)
Simple way:
$x = ,(1,2,3)
More Related Contents:
- Not all properties displayed
- Select the values of one property on all objects of an array in PowerShell
- Comparing two arrays & get the values which are not common
- Objects with no ‘.Count’ Property – use of @() (array subexpression operator) vs. [Array] cast
- Get-ChildItem.Length is Wrong
- Array.Add vs +=
- How do I pass an array as a parameter to another script?
- Pipe complete array-objects instead of array items one at a time?
- PowerShell copy an array completely
- A cmdlet which returns multiple objects, what collection type is it, if any? [PowerShell]
- How to add hashtable to multidimensional array? Cannot assign values via member-access enumeration
- Data Rows to String to Array issue
- Create a Single-Element Json Array Object Using PowerShell
- Powershell: Piping output of pracl command to array
- Return Multidimensional Array From Function
- PowerShell array initialization
- How do I call New-Object for a constructor which takes a single array parameter?
- Why is a leading comma required when creating an array?
- PowerShell doesn’t return an empty array as an array
- Getting “System.Collections.Generic.List`1[System.String]” in CSV File export when data is okay on screen
- Loop through an array of strings in Bash?
- Searching array reports “not found” even though it’s found
- Swift JSONDecode decoding arrays fails if single element decoding fails
- How do I sort a swift array containing instances of NSManagedObject subclass by an attribute value (date)
- Deleting Elements in an Array if Element is a Certain value VBA
- Binary Search algorithm implementations
- Can an array be top-level JSON-text?
- Convert multiline string to array [duplicate]
- MongoDB: find and findOne with nested array filtering
- Check if an element is present in a Bash array [duplicate]