Creating Tables...


i know simple, have never figured out... want create table custom column names. example:

i want make list of users 3 columns:

username        password                     addtoadmin
fflintstone       somepassword             false
brubble            someotherpass            true

shouldn't able create custom table / list / array or hash of kind create this?

i have 2 objectives. script needs self-contained. don't want script dependent on external file , want list of users easy @ in code itself. plan loop through list creating users  based on the fields each user (there more 3 columns / fields when done).

by creating customobject

$mycolumn = @{ name = 'user1'; password='password1'}
new-object psobject -property $mycolumn | select name,password | ft -autosize

name  password
----  --------
user1 password1

-------------------------------------------------------

to understand better...from username, password , addtoadmin values populated ?


thanks azam when see answers please mark answer if helpful..vote helpful.



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

0x300000d errors in Microsoft Remote Desktop client