Tag Archives: everything

How to Supercharge PowerShell Objects for Hyper-V

The best thing about working with PowerShell is that everything is an object. This makes it easy to work with the properties of the thing you need to manage without a lot of scripting or complex text parsing. For example, when using the Hyper-V PowerShell module it is trivial to get specific details of a virtual machine.

Getting virtual machine properties with PowerShell

There are many properties to this object. You can pipe the object to Get-Member to see the definition or Select-Object to show all properties and their values.

But what you want more? I usually do. For example, there is a CreationTime property for the virtual machine object. I’d like to be able to report on how old the virtual machine is. For a one-and-done approach I could write a command like this:

Defining a new custom property

Or maybe I’d like the MemoryAssigned value to be formatted in MB.

Defining a custom property for assigned memory

The syntax is to define a hashtable with 2 keys: Name and Expression. The Name value is what you want to use for your custom property name and the Expression is a PowerShell scriptblock. In the scriptblock you can run as much code as you need. Use $_ to reference the current object in the pipeline. In the last example, PowerShell looks at the MemoryAssigned value for the CentOS virtual machine object and divides it by 1MB. Then it moves on the DOM1 and divides the value (2147483648) by 1MB to arrive at 2048 and so on.

Using Select-Object this way is great for your custom scripts and functions. But suppose I want to get these values all the time when working with the object in the console interactively. I don’t want to have to type all that Select-Object code every single time. Fortunately, there is another approach.

PowerShell’s Extensible Type System

PowerShell has an extensible type system. This means you can extend or modify the type definition of an object. PowerShell takes advantage of this feature all the time. Many of the properties you’ve seen in common objects have been added by Microsoft. You can use the Get-TypeData cmdlet to view what additions have been made to a given type.

default extensions to the virtual machine object

You can see these additions with Get-Member.

Viewing the type additions

By now, you are thinking, “How can I do this?”. The good news is that it isn’t too difficult. Back in the PowerShell stone age you would have had to create a custom XML file, which you can still do. But I think it is just as easy to use the Update-TypeData cmdlet. I’ll give you some examples, but please take the time to read the full help and examples. One thing to keep in mind is that any type extensions you make last only as long as your PowerShell session is running. The next time you start PowerShell you will have to re-define them. I dot source a script file in my profile script that adds my type customizations.

Updating Type Data

The first thing you will need to know is the object’s type name. You can see that when piping to Get-Member.

When you define a new type you need to determine the membertype. This will be something like a ScriptProperty or Alias. A ScriptProperty is a value that is calculated by running some piece of PowerShell code. If you’ve created a custom type with Select-Object to test, as I did earlier, you will re-use that expression scriptblock. And of course, you need to define a name for your new property.

With this code, I’m defining a new script property called Age. The value will be the result of the scriptblock that subtracts the CreationTime property of the object from now. The one difference to note compared to my Select-Object version is that here use $this instead of $_.

I went ahead and also created an alias property of “Created” that points to “CreationTime”. If you try to create a type extension that already exists PowerShell will complain. I typically use -Force to overwrite any existing definitions. But now I can see these new type members.

Verifying new VM type extensions

And of course, I can use them in PowerShell.

Using the new type extensions in PowerShell

There’s really no limit to what you can do. Here is a script property that tells me when the VM started.

and here is some code that takes the memory properties and creates an ‘MB’ version of each one. I’m using some PowerShell scripting and splatting to simplify the process.

Now I have all sorts of information at my fingertips.

Taking advantage of all the new properties

As long as I run the Update-Typedata commands I will have this information available. In my PSHyperVTools module, which you can install from the PowerShell Gallery, it will add some of these type extensions automatically, plus a few more. You can read about it in the project’s GitHub repository.

Does this look like something you would use? What sort of type extensions did you come up with? What else do you wish you could see or do? Comments and feedback are always welcome.


Go to Original Article
Author: Jeffery Hicks

For Sale – Apple iMac 27″ 5K Late 2015 (i7, 16GB, SSD)

First time selling here on AvForums, hope everything is laid out as it’s meant to be. So here goes:

Selling my iMac 27 inch 5K Late 2015 model. Reason for sale is that I found work outside the UK and I’d rather sell this than going through the hassle of transporting it. If it doesn’t sell by the 15th of September I’ll archive this thread and make arrangements to take it with me. Price is non negotiable, I’ve priced this so it sells fast. If it doesn’t, like said I’ll pack it up and take it with me. Overall the iMac is in mint condition. There is one hairline scratch on the bottom of the frame which shows only when light is directed towards that area. Apart from that, I can’t see any scratches on the aluminium frame but there might be hairlines scratches on the base of it and some very small ones here and there but I just checked and can’t see anything else.

Specs:

27 inch 5K Retina screen – No faults, no dead pixels, no scratches.
CPU: i7 6700K at 4ghz.
Memory: 16GB (2X8gb) DDR3L 1866mhz
HD: Apple proprietary 512GB SSD (Apple SMO512G), faster than your average SSD, google it.
GPU (Graphics card): AMD Radeon R9 M395X with 4GB of GDDR5 memory.
Comes with Apple wireless keyboard and Apple trackpad.

Pics:

[​IMG]
[​IMG]
[​IMG]
[​IMG]
[​IMG]
[​IMG]
[​IMG]

Any questions please do ask.

Price and currency: £1000
Delivery: Goods must be exchanged in person
Payment method: Bank Transfer
Location: Milton Keynes
Advertised elsewhere?: Advertised elsewhere
Prefer goods collected?: I prefer the goods to be collected

______________________________________________________
This message is automatically inserted in all classifieds forum threads.
By replying to this thread you agree to abide by the trading rules detailed here.
Please be advised, all buyers and sellers should satisfy themselves that the other party is genuine by providing the following via private conversation to each other after negotiations are complete and prior to dispatching goods and making payment:

  • Landline telephone number. Make a call to check out the area code and number are correct, too
  • Name and address including postcode
  • Valid e-mail address

DO NOT proceed with a deal until you are completely satisfied with all details being correct. It’s in your best interest to check out these details yourself.

Go to Original Article
Author:

For Sale – Apple iMac 27″ 5K Late 2015 (i7, 16GB, SSD)

First time selling here on AvForums, hope everything is laid out as it’s meant to be. So here goes:

Selling my iMac 27 inch 5K Late 2015 model. Reason for sale is that I found work outside the UK and I’d rather sell this than going through the hassle of transporting it. If it doesn’t sell by the 15th of September I’ll archive this thread and make arrangements to take it with me. Price is non negotiable, I’ve priced this so it sells fast. If it doesn’t, like said I’ll pack it up and take it with me. Overall the iMac is in mint condition. There is one hairline scratch on the bottom of the frame which shows only when light is directed towards that area. Apart from that, I can’t see any scratches on the aluminium frame but there might be hairlines scratches on the base of it and some very small ones here and there but I just checked and can’t see anything else.

Specs:

27 inch 5K Retina screen – No faults, no dead pixels, no scratches.
CPU: i7 6700K at 4ghz.
Memory: 16GB (2X8gb) DDR3L 1866mhz
HD: Apple proprietary 512GB SSD (Apple SMO512G), faster than your average SSD, google it.
GPU (Graphics card): AMD Radeon R9 M395X with 4GB of GDDR5 memory.
Comes with Apple wireless keyboard and Apple trackpad.

Pics:

[​IMG]
[​IMG]
[​IMG]
[​IMG]
[​IMG]
[​IMG]
[​IMG]

Any questions please do ask.

Price and currency: £1000
Delivery: Goods must be exchanged in person
Payment method: Bank Transfer
Location: Milton Keynes
Advertised elsewhere?: Advertised elsewhere
Prefer goods collected?: I prefer the goods to be collected

______________________________________________________
This message is automatically inserted in all classifieds forum threads.
By replying to this thread you agree to abide by the trading rules detailed here.
Please be advised, all buyers and sellers should satisfy themselves that the other party is genuine by providing the following via private conversation to each other after negotiations are complete and prior to dispatching goods and making payment:

  • Landline telephone number. Make a call to check out the area code and number are correct, too
  • Name and address including postcode
  • Valid e-mail address

DO NOT proceed with a deal until you are completely satisfied with all details being correct. It’s in your best interest to check out these details yourself.

Go to Original Article
Author:

For Sale – MacBook 12 Space Grey 2017 i5 8gb 512gb ssd

hi folks, I’m having an Apple clear out so next to go is my MacBook 12. Out of everything this is the one that is hardest to get rid off as it is perfect for my needs, but I’ve fallen out with Apple and I’m stubborn so it’s getting punted lol.

I bought it from Very November 2017, still in great condition. Will come with extension for power lead and case. Fully boxed with all original accessories. I will get pics up ASAP but I’m offshore at the moment so won’t be able to post till I get home, which could be 2 weeks yet.

I have now added some pics my missus has taken. There are 4 marks round the edges. Two small chips near headphone jack and USB port. A small scratch near the port and another small mark. These are shown as clear as possible in the last three photos.

Price and currency: 1000
Delivery: Delivery cost is included within my country
Payment method: Bt ppg
Location: Dunfermline
Advertised elsewhere?: Advertised elsewhere
Prefer goods collected?: I have no preference

______________________________________________________
This message is automatically inserted in all classifieds forum threads.
By replying to this thread you agree to abide by the trading rules detailed here.
Please be advised, all buyers and sellers should satisfy themselves that the other party is genuine by providing the following via private conversation to each other after negotiations are complete and prior to dispatching goods and making payment:

  • Landline telephone number. Make a call to check out the area code and number are correct, too
  • Name and address including postcode
  • Valid e-mail address

DO NOT proceed with a deal until you are completely satisfied with all details being correct. It’s in your best interest to check out these details yourself.

For Sale – ASUS ROG GTX980 Poseidon Platinum

Selling my GTX980 as i rarely use my PC for gaming anymore . Its played everything I have chucked at it in the past and is still a brilliant card. It has the hybrid cooler, I’ve always ran it on air but it can be used in a proper water cooled rig. Just removed from PC today

Here’s the official Asus page :- POSEIDON-GTX980-P-4GD5 | Graphics Cards | ASUS United Kingdom
And there are plenty of reviews to back up the performance .

Price is £150 plus postage, its a good size box and quite hefty . I could deliver if you are local

gpuz.jpg

[​IMG]

[​IMG]

[​IMG]

[​IMG]

[​IMG]

Price and currency: £150
Delivery: Delivery cost is not included
Payment method: BT,Cash if being delivered
Location: Holywell , Tyne and Wear
Advertised elsewhere?: Not advertised elsewhere
Prefer goods collected?: I have no preference

______________________________________________________
This message is automatically inserted in all classifieds forum threads.
By replying to this thread you agree to abide by the trading rules detailed here.
Please be advised, all buyers and sellers should satisfy themselves that the other party is genuine by providing the following via private conversation to each other after negotiations are complete and prior to dispatching goods and making payment:

  • Landline telephone number. Make a call to check out the area code and number are correct, too
  • Name and address including postcode
  • Valid e-mail address

DO NOT proceed with a deal until you are completely satisfied with all details being correct. It’s in your best interest to check out these details yourself.

For Sale – MacBook 12 Space Grey 2017 i5 8gb 512gb ssd

hi folks, I’m having an Apple clear out so next to go is my MacBook 12. Out of everything this is the one that is hardest to get rid off as it is perfect for my needs, but I’ve fallen out with Apple and I’m stubborn so it’s getting punted lol.

I bought it from Very November 2017, still in great condition. Will come with extension for power lead and case. Fully boxed with all original accessories. I will get pics up ASAP but I’m offshore at the moment so won’t be able to post till I get home, which could be 2 weeks yet.

Price and currency: 1000
Delivery: Delivery cost is included within my country
Payment method: Bt ppg
Location: Dunfermline
Advertised elsewhere?: Advertised elsewhere
Prefer goods collected?: I have no preference

______________________________________________________
This message is automatically inserted in all classifieds forum threads.
By replying to this thread you agree to abide by the trading rules detailed here.
Please be advised, all buyers and sellers should satisfy themselves that the other party is genuine by providing the following via private conversation to each other after negotiations are complete and prior to dispatching goods and making payment:

  • Landline telephone number. Make a call to check out the area code and number are correct, too
  • Name and address including postcode
  • Valid e-mail address

DO NOT proceed with a deal until you are completely satisfied with all details being correct. It’s in your best interest to check out these details yourself.

Data guru living with ALS modernizes industries by typing with his eyes – Stories

The couple remodeled their two-story townhouse near Guatemala City so he had everything he needed on the first floor and didn’t have to navigate stairs. Otto learned to use a trackball mouse with his foot to type with an on-screen keyboard. But it was cumbersome, and he needed Pamela nearby to move the cursor from one corner of his two 32-inch screens to another as he navigated Excel spreadsheets and Power BI dashboards.

A tracheotomy was put in his throat to help him breathe, taking away his limited speech and increasing his isolation. But when Knoke, who spends two hours a day reading blogs and researching, saw his friend Juan Alvarado’s post about the new Eye Control feature in Windows 10, he let loose with his version of a shout and immediately ordered the Tobii Eye Tracker hardware to use with the software.

A man sits in a wheelchair while four women and two men crouch around him, touching his shoulders and arms and smiling.
Otto Knoke with his wife, daughters and sons-in-law. Photo provided by Pamela Knoke.

Alvarado, who met Knoke as a database consultant working on the ATM system Knoke had implemented, hadn’t known about Knoke’s condition until he suddenly saw him in a wheelchair one day. And fittingly, Eye Control itself began with a wheelchair.

Microsoft employees, inspired by former pro football player Steve Gleason, who had lost the use of his limbs to ALS, outfitted a wheelchair with  electronic gadgets to help him drive with his eyes during the company’s first Hackathon, in 2014. The project was so popular that a new Microsoft Research team was formed to explore the potential of eye-tracking technology to help people with disabilities, leading to last year’s release of Eye Control for Windows 10.

Knoke said it was “a joy” to learn how to type with his eyes, getting the feel of having sensors track his eye movements as he navigated around the screen and rested his gaze on the elements he wanted to click. Using Eye Control and the on-screen keyboard, he now can type 12 words a minute and creates spreadsheets, Power BI dashboards and even PowerPoint presentations. Combined with his foot-operated mouse, his productivity has doubled. He plans to expand his services to the U.S., where he spent six years studying and working in the 1970s. He no longer relies on his wife’s voice, because Eye Control offers a text-to-speech function as well.

“It was frustrating trying to be understood,” Knoke said in the email interview. “After a few days of using Eye Control I became so independent that I did not need someone to interact with clients when there were questions or I needed to explain something. We have a remote session to the client’s computer, and we open Notepad and interact with each other that way.”

His wife and his nurse had learned to understand the sounds he was able to make, even with the tracheotomy restricting his vocal chords. But now he can communicate with his three grown daughters, his friends and all his customers.

A man lies in a reclining chair, while a younger woman sits in a chair next to him. Both are smiling and looking at a computer screen with a Spanish phrase typed on it.
Using a foot-operated mouse, Eye Control for Windows 10 and the text-to-speech function, Otto Knoke is able to communicate with his family — including his daughter, seen here — as well as with clients.

“Now when our children visit, he can be not just nodding at what they say, but he can be inside the conversation, too,” Pamela Knoke said. “He always has a big smile on his face, because he’s got his independence back.”

He’s also started texting jokes to friends again.

“It’s kind of like it brought my friend back, and it’s amazing,” Alvarado said. “Otto told me that for him, it was like eye tracking meant his arms can move again.”

Being able to text message with Eye Control has helped his business as well.

Grupo Tir, a real-estate development and telecommunications business in Guatemala, hired Knoke for several projects, including streamlining its sales team’s tracking of travel expenses with Power BI.

“Working with Otto has been amazing,” said Grupo Tir Chief Financial Officer Cristina Martinez. “We can’t really meet with him, so we usually work with texts, and it’s like a normal conversation.

“He really has no limitations, and he always is looking for new ways to improve and to help companies.”

For Sale – Gigabyte Z370 HD3P Motherboard (Brand New)

Brand new Gigabyte Mainboard socket LGA 1151 For Sale everything included as it would be… price includes postage

£130.00 at www.scan.co.uk

Price and currency: £105
Delivery: Delivery cost is included within my country
Payment method: Bank Transfer
Location: Skelmersdale
Advertised elsewhere?: Not advertised elsewhere
Prefer goods collected?: I have no preference

______________________________________________________
This message is automatically inserted in all classifieds forum threads.
By replying to this thread you agree to abide by the trading rules detailed here.
Please be advised, all buyers and sellers should satisfy themselves that the other party is genuine by providing the following via private conversation to each other after negotiations are complete and prior to dispatching goods and making payment:

  • Landline telephone number. Make a call to check out the area code and number are correct, too
  • Name and address including postcode
  • Valid e-mail address

DO NOT proceed with a deal until you are completely satisfied with all details being correct. It’s in your best interest to check out these details yourself.

For Sale – Asus ac68u – Cable router

Asus ac68u

Comes with the original box and everything needed to get up and running

Price and currency: £70
Delivery: Delivery cost is included within my country
Payment method: bank transfer
Location: stoke on trent
Advertised elsewhere?: Advertised elsewhere
Prefer goods collected?: I have no preference

______________________________________________________
This message is automatically inserted in all classifieds forum threads.
By replying to this thread you agree to abide by the trading rules detailed here.
Please be advised, all buyers and sellers should satisfy themselves that the other party is genuine by providing the following via private conversation to each other after negotiations are complete and prior to dispatching goods and making payment:

  • Landline telephone number. Make a call to check out the area code and number are correct, too
  • Name and address including postcode
  • Valid e-mail address

DO NOT proceed with a deal until you are completely satisfied with all details being correct. It’s in your best interest to check out these details yourself.

For Sale – Asus ac68u – Cable router

Asus ac68u

Comes with the original box and everything needed to get up and running

Price and currency: £70
Delivery: Delivery cost is included within my country
Payment method: bank transfer
Location: stoke on trent
Advertised elsewhere?: Advertised elsewhere
Prefer goods collected?: I have no preference

______________________________________________________
This message is automatically inserted in all classifieds forum threads.
By replying to this thread you agree to abide by the trading rules detailed here.
Please be advised, all buyers and sellers should satisfy themselves that the other party is genuine by providing the following via private conversation to each other after negotiations are complete and prior to dispatching goods and making payment:

  • Landline telephone number. Make a call to check out the area code and number are correct, too
  • Name and address including postcode
  • Valid e-mail address

DO NOT proceed with a deal until you are completely satisfied with all details being correct. It’s in your best interest to check out these details yourself.