Browse Source

Replaced -GitClone with -NoGitClone

master
lksz 1 year ago
parent
commit
c25de685c1
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      Setup-Profile.ps1

+ 5
- 5
Setup-Profile.ps1 View File

@@ -3,7 +3,7 @@
[switch]$RemoveOnly,
[switch]$ShowSkipped,
[switch]$Force,
[switch]$GitClone,
[switch]$NoGitClone,
[string]$GitURL = 'https://code.lksz.me/lksz/PowerShell_Scripts',
[Parameter(DontShow)]
[string]$MyPSScriptRoot = $MyPSScriptRoot
@@ -15,7 +15,7 @@ function _Setup {
[switch]$RemoveOnly,
[switch]$ShowSkipped,
[switch]$Force,
[switch]$GitClone,
[switch]$NoGitClone,
[string]$GitURL = 'https://code.lksz.me/lksz/PowerShell_Scripts',
[Parameter(DontShow)]
[string]$MyPSScriptRoot = $MyPSScriptRoot)
@@ -40,9 +40,9 @@ Get-Command Reload-MyScripts -ErrorAction SilentlyContinue | ForEach-Object { .
## _Setup Logic starts here
#######################################################################

if ( $GitClone -and -not (Test-Path $(Join-Path $MyPSScriptRoot '.git')) ) {
if ( -not $NoGitClone -and -not (Test-Path $(Join-Path $MyPSScriptRoot '.git')) ) {
if ( -not [bool]$(Get-Command git -ErrorAction SilentlyContinue) ) {
throw "No git command found, you may either omit the -GitClone switch or install git and try again."
throw "No git command found, you may either omit run with the -NoGitClone switch or install git and try again."
}
if ( $PSCmdlet.ShouldProcess("Pull git repo from $GitURL into $MyPSScriptRoot ?") ) {
Push-Location $MyPSScriptRoot
@@ -59,7 +59,7 @@ Get-Command Reload-MyScripts -ErrorAction SilentlyContinue | ForEach-Object { .
$GitOutput = "$(& git checkout --force)"
Write-Verbose $GitOutput
Pop-Location
Write-Verbose "-GitClone step done."
Write-Verbose "Git clone done."
}
}



Loading…
Cancel
Save