Using Object properties

A lot of people see PowerShell as conversion tool, but it can do so much more.

It can uninstall apps, inventory your applications. Rename files to a standard. Create shares, modify files and sessions and give an Administrator access to a computer without interrupting a session.

It is built on .net/c# so it can do everything a program can. You just have to know your property and methods on your objects.

I am mainly speaking about windows platform. I may do a write up on Linux impact.

I can write excel, word files with out office being installed, send emails and query websites for remote data. Consolidated information and write to databases. The list is ridiculous.

I wanted to interact more so I would like to take on a challenge from the comments. What is something you think you cannot do in PowerShell?!


AWS/GoogleCloud and harnessing PowerShell (One Shell to rule them all)

Heads up….. The cloud is ready.

There is alot of fun to be had with different Platforms and PowerShell grew up on the mean streets of scrutiny, much like myslef and we are much alike in our flexibility to adapt and automate anything, although I am sure PowerShell probably doesn’t need me as much as I rely on it’s abilities to be context sensitive to my tab key.

Looking at the featured image i used for the article it is clear to see a lot of platforms have embraced PowerShell with a favorable amount of cmdlets. JUST THINK OF THE AUTOMATION POSSIBILITIES!

Okay, so to warn you ahead of time, I maybe diving into all the cloud crowds shortly to give myself an expanse of elbow room when scripting solutions.

Stay informed and do not forget to Get-Help!

This is for amazon webservices:

Install-Module -Name AWSPowerShell

This is for GoogleCloud:

find-module -Name googlecloud | install-module 

This may may only possible after you enable and trust the repositories.

Take Care Citizen!

Scripting Technique, Uncategorized

Add-Member if you want to effectively “object” all things and possess their property.

I thought I would clarify this as most articles don’t simplify this to easily wrap you head around.

Add-member is what I would use to add a new member to a group of properties on an object

  1. I create the object
  2.  Add a noteproperty that translate to text
  3. create a scriptmethod that can do things based on a scriptblock when called.
  4. create a scriptproperty that runs each time you call the $x object to display the results of it’s script block.
Here is the code:
$x=new-object psobject
$x| add-member -name ID – value “smithx” -membertype Noteproperty
$x| add-member -name ADlookup -value { get-aduser $x.name } -membertype scriptmethod
$x|add–member -name ADinfo -value {$x.adlookup()} -membertype Scriptproperty

if you want you can overwrite a member with the -force command.