$ProductKey = $ProductKey.Insert($i, '-') $ProductKey = $ProductKey.Insert($r, 'N') Write-Verbose (": Translating data into product key" -f $Computer) You will also notice that I set the type for Computername to ] which means that it will take a collection of strings for that parameter. I also add some aliases to support the ValueFromPipeLineByPropertyName which allows extra pipeline support. I also add some parameters to the existing code with a default parameter value for the Computername to point to the local machine. Computername, ProductKey,OSDescription,OSVersionįirst off, lets add some comment based help to this code:.In the object, show the following properties.Allow this function to query remote systems not just locally. The list of items I wanted to add to the existing code are: By doing this, you can see just how easy it is to take some existing code and modify it to meet your own specific requirements. However, being that I had a little free time and really like this code, I wanted to enhance it to make it more robust by adding a few extra things here and there. $value = (get-itemproperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").digitalproductid
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |