Object Initialization in Powershell script

Hello

I am writing a powershell script and can you please let me know how i have initialize object in it.

I want initialize object for "QAProfileInfo "  and UserInfo these Quest one password management web API.

Thanks

February 16th, 2015 4:22pm

Hi,

Perhaps this will help:

http://ss64.com/ps/new-object.html

Free Windows Admin Tool Kit Click here and download it now
February 16th, 2015 4:36pm

Thanks  Mike

Can you please let me know how i have to create list and iterate that.

Please let me  know if you have any idea about Quest One password Management API.

http://documents.software.dell.com/DOC203139

February 16th, 2015 5:09pm

You need to post Quest issues in the Dell forums for that product.

Free Windows Admin Tool Kit Click here and download it now
February 16th, 2015 5:16pm

ok JRV

But how I have to create list and iterate that list in Powershell.

Can you please give example

February 16th, 2015 5:40pm

Thanks  Mike

Can you please let me know how i have to create list and iterate that.

Please let me  know if you have any idea about Quest One password Management API.

http://documents.software.dell.com/DOC203139

Sorry, I don't have any experience with any Quest products so I'm not even sure where to start. I'd follow jrv's suggestion and post over in the Quest forums. They should have some better help for you there.

Good luck.

Free Windows Admin Tool Kit Click here and download it now
February 16th, 2015 6:16pm

Hi Mike/JRV

I am not asking about quest, how we can make a List object and iterate them in Powershell.

Thanks
February 17th, 2015 8:37am

Something like this?

https://technet.microsoft.com/en-us/library/ee692802.aspx

Free Windows Admin Tool Kit Click here and download it now
February 17th, 2015 8:47am

Hi sreepp,

you can create a list of items and iterate it like this:

# Create List
$list = @(1, 2, 3)

# Add item to list
$list += 4

# iterate over list
foreach ($item in $list)
{
    # Do whatever you want with it
    Write-Output $item * $item
}

There are more ways to iterate over items and other methods to create lists, but this should get you started in the right direction.

Cheers,
Fred

February 17th, 2015 9:13am

thanks

but how i can create a list based type of class.

Free Windows Admin Tool Kit Click here and download it now
February 17th, 2015 11:36am

Hi,

that list is not type-specific. You can simply add whatever you want into it (and mix it too).

If you want a list for a specific type only you can cast to an array for a specific task. Here an Example for IP Addresses:

[System.Net.IPAddress[]]$IPs = @()

If you need something more product specific, you really should ask in the forums of the developer (Dell apparently in your case) for more support.

Cheers,
Fred

February 17th, 2015 11:53am

Hi Mike/JRV

I am not asking about quest, how we can make a List object and iterate them in Powershell.

Thanks

What is it that you are calling a list object.

Here is an arraylinst:

$alist=[collections.arraylist](get-Process)

Again - since you are trying to follow insstructions for using Quest you really need to post inquest forums.

Free Windows Admin Tool Kit Click here and download it now
February 17th, 2015 2:18pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics