Add PowerShell uninstall script
parent
396c41c1f6
commit
c881d563ed
1 changed files with 14 additions and 0 deletions
|
@ -186,3 +186,17 @@ for section in conf:
|
|||
print("Removing ", realpath)
|
||||
os.unlink(realpath)
|
||||
```
|
||||
|
||||
Here's an equivalent script for PowerShell ([source](https://github.com/anishathalye/dotfiles_template/pull/19#issuecomment-729518540), [powershell-yaml](https://github.com/cloudbase/powershell-yaml) required)
|
||||
|
||||
```ps
|
||||
$CONFIG = "install.conf.yaml"
|
||||
|
||||
$confObj = ConvertFrom-Yaml ([string](Get-Content $CONFIG -Raw))
|
||||
foreach ($target in ($confObj | Where-Object Keys -eq link).Values.Keys) {
|
||||
if ((Get-Item $target -Force -ErrorAction SilentlyContinue).LinkType -eq "SymbolicLink") {
|
||||
Write-Host "Removing $target" -ForegroundColor Red
|
||||
Remove-Item $target
|
||||
}
|
||||
}
|
||||
```
|
Loading…
Reference in a new issue