install-vmwworkstation.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

<#PSScriptInfo
 
.VERSION 3.0
 
.GUID 20ee6b60-98a5-4519-9b4e-3872142b9df6
 
.AUTHOR Karsten.Bott@labbuildr.com
 
.COMPANYNAME
 
.COPYRIGHT
 
.TAGS
 
.LICENSEURI
 
.PROJECTURI
 
.ICONURI
 
.EXTERNALMODULEDEPENDENCIES
 
.REQUIREDSCRIPTS
 
.EXTERNALSCRIPTDEPENDENCIES
 
.RELEASENOTES
 
 
#>


<#
 
.DESCRIPTION
 This script is a helper to download and kick installation of vmware-workstation
 
#>
 
Param()
$Destination = "$HOME/Downloads"
$request = Invoke-WebRequest -MaximumRedirection 0 -Uri "https://www.vmware.com/go/getworkstation-win"  -UseBasicParsing -ErrorAction SilentlyContinue
$file = $request.Headers.Location
$myfile = split-path -leaf $request.Headers.Location
try {
    Start-BitsTransfer $file -Description "Downloding $myfile" -Destination $Destination -TransferType Download
}
catch
    {
    write-host "Error Occured"
    }

Start-Process -FilePath "$Destination/$myfile" -Wait