Get-Object or equivalent command

I'm working with some software and I'm needing to create a new COM object. I have a powershell script that uses "New-Object -ComObject" with all the settings to create this object. My question is how I can determine if this script has already been run. I have seen some articles refer to a Get-Object command, but Windows doesn't recognize that command. Is there any way I can see if I have already created this object on a specific machine?
Jason TenpennyNOC ManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David SankovskySenior SysAdminCommented:
I don't see a Get-Object CMDLET on technet, but searching CMDLETs that are related to New-Object, I came across this one:
Select-Object. Perhaps it can help your cause.
0
ITguy565Commented:
you could try this :

$test = New-Object Psobject -Property @{  Testprop = "" }
if (($test | gm | select -exp name) -contains 'testprop' ) {"true"}
else { "false" }

Open in new window


reference : https://social.technet.microsoft.com/Forums/windowsserver/en-US/843e2734-d96f-4ce4-96d5-7b5a00b85eb9/check-object-property-existance?forum=winserverpowershell
0
ITguy565Commented:
change it to meet your needs as I don't know your object names.
0
Challenges in Government Cyber Security

Has cyber security been a challenge in your government organization? Are you looking to improve your government's network security? Learn more about how to improve your government organization's security by viewing our on-demand webinar!

Jason TenpennyNOC ManagerAuthor Commented:
I figured out what registry setting it was changing and am looking it up via the registry.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David SankovskySenior SysAdminCommented:
Jason, If any of the question above helped you in the right direction, Please assign points as you see fit,
if you arrived on the solution completely on your own, that's great too, But please don't leave the question open, close it.
I'm glad that you resolved your issue though.
0
Jason TenpennyNOC ManagerAuthor Commented:
I've tried a couple of times to mark my own comment as the answer, but I keep getting an error every time.
0
David SankovskySenior SysAdminCommented:
I've open a request to a moderator, he should be able to assist.
0
Jason TenpennyNOC ManagerAuthor Commented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.