I'll show you here how to add them for the folders and use the Mobile Assets as an example, but the views are the same principal.
- Grab an image you want to use and get it sized appropriately, I used a 16 x 16 pixel image, called it mobilephone16x16.png and saved it in the same dir as the MP I was creating.
- Add this XML at the bottom of your MP to reference the file:
<Image ID="Image.MobilePhoneFolder.16x16" Accessibility="Public" FileName="mobilephone16x16.png" HasNullStream="false"/>
- Add this XML to the Categories section (after TypeDefinitions and before Presentation):
<Category ID="Category.MobilePhoneFolderImage16x16" Target="Image.MobilePhoneFolder.16x16" Value="System!System.Internal.ManagementPack.Images.u16x16Icon"/>
- Add this XML to the ImageReferences section (before StringResources):
<ImageReference ElementID="Folder.Mobiles" ImageID="Image.MobilePhoneFolder.16x16"/>
- Use the new-mpbfile.ps1 powershell script to bundle the MP and images together into a MPB file.
Step 1 is find and save you picture in the right size/format
Step 2 is add the section that tells the MP where to find the graphic
Step 3 tells the MP what size and usage etc the image is
Step 4 tells the MP to link the image to the folder (this is where you could point the image at a view instead)
Step 5 bundles the images and MP together into a MPB for importing