diff --git a/images/win/scripts/Installers/Install-Git.ps1 b/images/win/scripts/Installers/Install-Git.ps1 index db2eb3911..4f543f5b2 100644 --- a/images/win/scripts/Installers/Install-Git.ps1 +++ b/images/win/scripts/Installers/Install-Git.ps1 @@ -9,9 +9,20 @@ Choco-Install -PackageName git -ArgumentList '--installargs="/VERYSILENT /NOREST # Install hub Choco-Install -PackageName hub +# Install GVFS +$url = "https://api.github.com/repos/microsoft/VFSForGit/releases/latest" +[System.String] $gvfsLatest = (Invoke-RestMethod -Uri $url).assets.browser_download_url -match "SetupGVFS.+\.exe$" +$gvfsInstallerPath = Start-DownloadWithRetry -Url $gvfsLatest -Name "SetupGVFS.exe" + +# Start-Process waits on the entire process tree but Wait-Process only waits on the initiating process(GVFS.Service.UI.exe) +$env:GVFS_UNATTENDED = "1" +$argList = "/VERYSILENT", "/NORESTART", "/NOCANCEL", "/SP-", "/CLOSEAPPLICATIONS", "/RESTARTAPPLICATIONS", "/SUPPRESSMSGBOXES" +Start-Process $gvfsInstallerPath -ArgumentList $argList -PassThru | Wait-Process + # Disable GCM machine-wide [Environment]::SetEnvironmentVariable("GCM_INTERACTIVE", "Never", [System.EnvironmentVariableTarget]::Machine) +# Add to PATH Add-MachinePathItem "C:\Program Files\Git\bin" if (Test-IsWin16) { @@ -22,5 +33,5 @@ if (Test-IsWin16) { ssh-keyscan -t rsa github.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" ssh-keyscan -t rsa ssh.dev.azure.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts" -Invoke-PesterTests -TestFile "Git" -TestName "Git" +Invoke-PesterTests -TestFile "Git" Invoke-PesterTests -TestFile "CLI.Tools" -TestName "Hub CLI" diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index a8e6d9472..8a2820a3d 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -86,6 +86,7 @@ $markdown += New-MDList -Style Unordered -Lines (@( (Get-GHCVersion), (Get-GitVersion), (Get-GitLFSVersion), + (Get-GVFSVersion), (Get-GoogleCloudSDKVersion), (Get-InnoSetupVersion), (Get-JQVersion), diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index c769c6260..c49374ea5 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -67,6 +67,11 @@ function Get-GitLFSVersion { return "Git LFS $gitLfsVersion" } +function Get-GVFSVersion { + $gvfsVersion = (Get-Command gvfs).Version + return "GVFS $gvfsVersion" +} + function Get-InnoSetupVersion { return $(choco list --local-only innosetup) | Select-String -Pattern "InnoSetup" } diff --git a/images/win/scripts/Tests/Git.Tests.ps1 b/images/win/scripts/Tests/Git.Tests.ps1 index 9b71aa0b8..b9d6a8e0a 100644 --- a/images/win/scripts/Tests/Git.Tests.ps1 +++ b/images/win/scripts/Tests/Git.Tests.ps1 @@ -23,3 +23,9 @@ Describe "Git" { $env:GCM_INTERACTIVE | Should -BeExactly Never } } + +Describe "GVFS" { + It "GVFS is installed" { + "gvfs --version" | Should -ReturnZeroExitCode + } +}