Installing GIT with out asking prompts with powershell

Varma 1,495 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.
9,013 questions
Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Gowtham CP 6,020 Reputation points Volunteer Moderator
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.