SOLVED: Console Extension Pack installation Powershell

Discussions related to using VirtualBox on Windows hosts.

SOLVED: Console Extension Pack installation Powershell

Postby ft systems gmbh » 30. Nov 2017, 14:01

Hi together

I've written a Powershellscript to Install the Extension Pack and want to share it here.
Unfotunatelly this message comes: "You must be a member for 1 days and have 1 posts before you can post u r l." (Because I have some U R L to refer)
Even the word "U R L" is not allowed for the first Post. Thats why I write it with spaces.

So, I create my first post with this and publish the script tomorrow. :wink:

Kind Regards
ft systems gmbh
Posts: 2
Joined: 30. Nov 2017, 13:52

Re: SOLVED: Console Extension Pack installation Powershell

Postby socratis » 30. Nov 2017, 15:19

Don't post the URL, post the instructions here. You never know when your hosting site might go down. Again, please post the instructions here, not in a 3rd party site. Thank you.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
Site Moderator
Posts: 19677
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

Re: SOLVED: Console Extension Pack installation Powershell

Postby ft systems gmbh » 3. Dec 2017, 14:59

Hi together

@socratis: I always wanted to post the solution, not just a link. But for documentation reason (source links of some code snippets) my post contains URL's. Sorry when I was unspecific. :-)

Based on this page viewtopic.php?f=7&t=44337 I've written a Powershellscript.
I've written some potential improvements in the script. (See "The following features are not implemented yet.") Feel free to implement and share them.

Have fun.

Kind Regards

Code: Select all   Expand viewCollapse view
# Scriptname: 171130_virtualbox_extpack-vALL-both-mui.ps1
# 30.11.2017, Michael Nydegger,
# Titel: Download and install proper extension pack for Virtualbox
# Description: This script downloads the proper VirtualBox ExtensionPack.
# Oracle VM VirtualBox Extension Pack is only for personal and evaluation use!
# See
# The following features are not implemented yet. Feel free to implement and share it:
# - Check if downloadfile exists before downloading. Line 40
# - Check if the current Version of Extension pack is installed. if yes -> abort installation
# - Check if VirtualBox Extension Pack was successfully installed

# Testing
# -------
# Tested as followed:
# - Install on Virtualbox Version 5.2.2r119230
# - Install on Virtualbox Version 5.1.30
# - Install on Virtualbox Version 5.1.30. Executed this script. Updated Virtualbox to 5.2.2r119230. Run this script again.

# Manual of "VBoxManage.exe":

# Check if "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" exists aka Virtualbox is installed
# Source:

if(Test-Path "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"){

   # Get version of the installed VirtualBox
   $VBOX_VERSION_PLAIN = & "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" -v

   # Cut string of version
   # Source:
   # Get version without number after letter "r"
   # Get number after letter "r"

   # Create Filename to download
    # Example filename: Oracle_VM_VirtualBox_Extension_Pack-5.1.30-118389.vbox-extpack 
   $VBOX_FILENAME = "Oracle_VM_VirtualBox_Extension_Pack-" + $VBOX_VERSION_CUT_BEFORE + "-" + $VBOX_VERSION_CUT_AFTER + ".vbox-extpack"

   # Create full downloadpath

   # Check if link exist
   # Source:
   # not implemented yet. Feel free to complete

   # Download file
   # Install the downloaded package
    # "--replace" removes old versions first.
    # Accept License. Source:
   echo y | & "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" extpack install --replace $VBOX_FILENAME
   # "Used to remove temporary files and directories that may have been left behind if a previous install or uninstall command failed." - Copied from
   & "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" extpack cleanup
    # Delete downloaded file
    Remove-Item $VBOX_FILENAME -Force

   $EXITMESSAGE = "Installation finished"
   $EXITCODE = 0

   $EXITMESSAGE = "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe not found. Probably Virtualbox is not installed."
   $EXITCODE = 1
ft systems gmbh
Posts: 2
Joined: 30. Nov 2017, 13:52

Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: No registered users and 45 guests