Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Working With Arrays

$
0
0

I am looking to create a function to gather inputs for an array. I can only find the param value that would go within another function, however I would like to have something that users could do once, and the values would be placed into the Array names, $ComputerName and $UserName.

Here is what I have at the beginning of each other function;

function Fill-Variables { [CmdletBinding()] param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true, Position=0)] [Alias("hostname")] [String[]]$ComputerName, [Parameter(Mandatory=$true, ValueFromPipeline=$false, Position=1)] [String]$UserName ) } 

submitted by /u/Heated_Moon
[link] [comments]

The post Working With Arrays appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Latest Images

Trending Articles



Latest Images