Installing GIT with out asking prompts with powershell

Varma 1,250 Reputation points
2024-05-31T09:42:13.34+00:00

I am using below link and using windows 64 bit standalone installer. https://git-scm.com/download/win

I can install this manually , but i want to install git in agent ( target machine) using powershell with out asking for any prompts , can we do that, if so please suggest the command

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,385 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,432 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,223 questions
0 comments No comments
{count} votes

Accepted answer
  1. Gowtham CP 3,575 Reputation points
    2024-05-31T10:15:40.7633333+00:00

    Hello Varma ,

    Thanks for reaching out in the Microsoft Q&A!

    To install Git silently on your target machine using PowerShell, replace C:\path\to\Git-2.39.0-64-bit.exe with the actual path to your downloaded installer and run this command:

    $installerPath = "C:\path\to\Git-2.39.0-64-bit.exe"  
    # Run the installer in silent mode with specified installation directory
    Start-Process -FilePath $installerPath -ArgumentList "/SILENT", "/NORESTART", "/DIR=C:\Program Files\Git" -Wait -NoNewWindow
    

    Please let me know if you have further questions.

    If the response helped, do "Accept Answer" and up-vote it to close the thread! Thanks!

    0 comments No comments

0 additional answers

Sort by: Most helpful