New-ChocoBearInstallConfig.ps1
function New-ChocobearInstallConfig() { Param( [string] $Path = $null ) $json ="{ `"path`": null, `"toolsDirectory`": null, `"feeds`": { `"choco-bear`": `"https://www.myget.org/F/choco-bear/api/v2`", `"chocolatey`": `"http://chocolatey.org/api/v2`" } }" if(![string]::IsNullOrWhiteSpace($Path)) { if(! (Test-Path $Path)) { mkdir $Path | Write-Debug } } else { if(Test-Path "$Env:USERPROFILE/OneDrive/.choco-bear") { $Path = "$Env:USERPROFILE/OneDrive/.choco-bear" } else { $Path = "$Env:USERPROFILE/.choco-bear" if(! (Test-Path $Path)) { mkdir $Path | Write-Debug } } } [System.IO.File]::WriteAllText("$Path/choco-bear-setup.json", $json); } |