Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create PowerShell install script #19

Closed
wants to merge 3 commits into from
Closed

Create PowerShell install script #19

wants to merge 3 commits into from

Conversation

sitiom
Copy link
Contributor

@sitiom sitiom commented Nov 17, 2020

I would like to have a quick way to install my dotfiles in Windows without needing MSYS2 or Git Bash. This would prove quite useful.

@sitiom
Copy link
Contributor Author

sitiom commented Nov 18, 2020

Here's a simple uninstall script for PowerShell that only depends on powershell-yaml.

$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
    }
}

@anishathalye
Copy link
Owner

This looks interesting, thanks for the pull request! It might be a little bit of time until I can review it. I think it might be neat to include it in Dotbot as well (rather than just this dotfiles template).

I don't want to include an uninstall script (because in general, an arbitrary install can't be un-done effectively) along with Dotbot, but there's one available in the wiki for people who want it. You could add your PowerShell version there.

@sitiom
Copy link
Contributor Author

sitiom commented Nov 22, 2020

I don't want to include an uninstall script (because in general, an arbitrary install can't be un-done effectively) along with Dotbot, but there's one available in the wiki for people who want it. You could add your PowerShell version there.

Alright, added it to the wiki

This looks interesting, thanks for the pull request! It might be a little bit of time until I can review it. I think it might be neat to include it in Dotbot as well (rather than just this dotfiles template).

Oh wait, I didn't notice it was there in the dotbot repo as well. Will do

@anishathalye
Copy link
Owner

Squashed/merged!

@sitiom sitiom deleted the posh-install-script branch February 26, 2021 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants