小编Pri*_*ani的帖子

如何在Chocolatey安装后刷新PowerShell会话的环境,而无需打开新会话

我正在编写自动脚本,用于将GitHub源代码克隆到本地机器.
我在我的脚本中安装Git后失败了,它要求close/open powershell.
所以我无法在安装Git后自动克隆代码.

这是我的代码:

iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
 choco install -y git
 refreshenv
 Start-Sleep -Seconds 15

 git clone --mirror https://${username}:${password}@$hostname/${username}/$Projectname.git D:\GitTemp -q 2>&1 | %{ "$_" } 
Run Code Online (Sandbox Code Playgroud)

错误:

git : The term 'git' is not recognized as the name of a cmdlet, 
      function, script file, or operable program. 
      Check the spelling of the name, or if a path was included, 
      verify that the path is correct and try again.
Run Code Online (Sandbox Code Playgroud)

请告诉我应该在不退出的情况下重新启动PowerShell?

powershell installation refresh environment-variables chocolatey

9
推荐指数
1
解决办法
7515
查看次数

如何在将 TFS 克隆到 Windows Powershell 中的 git 时传递用户名和密码

我想将 TFS 存储库导入 git 并克隆到我的本地机器,我正在使用 git-tf。在我的代码下面:- git-tf clone http://server:8080/tfs/DefaultCollection $/SampleProject D:\TFSRepoName 我想在 url 中传递用户名和密码,所以它自动克隆 repo 而不要求用户名和密码。

tfs git-tf

8
推荐指数
1
解决办法
1万
查看次数

如何使用Powershell为窗口下载并安装git客户端

我必须编写自动的powershell脚本来从gihtub克隆存储库,但是我需要使用命令行安装git。请让我知道如何在不使用任何手动工作的情况下使用命令行在窗口上下载和安装git。

提前致谢 !

git powershell

3
推荐指数
3
解决办法
4157
查看次数

如何在不使用 AutoScaling 的情况下使用 aws cloudformation 启动多个 EC2 实例?

我想使用 aws cloudformation 模板启动多个 Ec2 实例,而不使用 AutoScaling。请让我知道如何启动?

amazon-web-services aws-cloudformation

2
推荐指数
1
解决办法
5810
查看次数