10 Star 65 Fork 0

Gitee 极速下载/chocolatey

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/chocolatey/chocolatey
克隆/下载
test.ps1 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
$scriptPath = (Split-Path -parent $MyInvocation.MyCommand.path)
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$principal = New-Object System.Security.Principal.WindowsPrincipal( $identity )
$isAdmin = $principal.IsInRole( [System.Security.Principal.WindowsBuiltInRole]::Administrator )
$chocoDir = $env:ChocolateyInstall
if(!$chocoDir){$chocoDir="$env:AllUsersProfile\chocolatey"}
if(!(Test-Path($chocoDir))){$chocoDir="$env:SystemDrive\chocolatey"}
$chocoDir = $chocoDir.Replace("\bin","")
$env:Path +=";$chocoDir\bin;"
Write-Host "Path is $($env:Path)"
$pesterVersion = '2.0.2'
cinst pester -version $pesterVersion
$pesterDir = "$chocoDir\lib\Pester.$pesterVersion"
if(-not $isAdmin){
$psi = New-Object System.Diagnostics.ProcessStartInfo
$psi.FileName="$env:windir\System32\WindowsPowerShell\v1.0\powershell.exe"
$psi.Verb="runas"
$psi.Arguments="-NoProfile -ExecutionPolicy unrestricted -Command `". { CD '$scriptPath';. '$pesterDir\tools\bin\pester.bat'; `$ec = `$?;if(!`$ec){Write-Host 'Press any key to continue ...';`$host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');exit 1} } `""
$s = [System.Diagnostics.Process]::Start($psi)
$s.WaitForExit()
exit $s.ExitCode
} else {
. "$pesterDir\tools\bin\pester.bat"
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/chocolatey.git
git@gitee.com:mirrors/chocolatey.git
mirrors
chocolatey
chocolatey
master

搜索帮助