Giter VIP home page Giter VIP logo

dotfiles-windows's Introduction

Leonel's dotfiles for Windows

A collection of PowerShell files for Windows, including common application installation through Chocolatey and npm, and developer-minded Windows configuration defaults.

Completely based in Jay Harris's own dotfiles-windows.

Installation

Using Git and the bootstrap script

You can clone the repository wherever you want. (I like to keep it in ~\Projects\dotfiles-windows.) The bootstrapper script will copy the files to your PowerShell Profile folder.

From PowerShell:

git clone https://github.com/leonelgalan/dotfiles-windows.git; cd dotfiles-windows; . .\bootstrap.ps1

To update your settings, cd into your local dotfiles-windows repository within PowerShell and then:

. .\bootstrap.ps1

Note: You must have your execution policy set to unrestricted (or at least in bypass) for this to work: Set-ExecutionPolicy Unrestricted.

Git-free install

Note: You must have your execution policy set to unrestricted (or at least in bypass) for this to work. To set this, run Set-ExecutionPolicy Unrestricted from a PowerShell running as Administrator.

To install these dotfiles from PowerShell without Git:

iex ((new-object net.webclient).DownloadString('https://raw.github.com/leonelgalan/dotfiles-windows/master/setup/install.ps1'))

To update later on, just run that command again.

Add custom commands without creating a new fork

If .\extra.ps1 exists, it will be sourced along with the other files. You can use this to add a few custom commands without the need to fork this entire repository, or to add commands you don't want to commit to a public repository.

My .\extra.ps1 looks something like this:

# Git credentials
# Not in the repository, to prevent people from accidentally committing under my name
Set-Environment "GIT_AUTHOR_NAME" "Leonel Galan"
Set-Environment "GIT_COMMITTER_NAME" $env:GIT_AUTHOR_NAME
git config --global user.name $env:GIT_AUTHOR_NAME
Set-Environment "GIT_AUTHOR_EMAIL" "[email protected]"
Set-Environment "GIT_COMMITTER_EMAIL" $env:GIT_AUTHOR_EMAIL
git config --global user.email $env:GIT_AUTHOR_EMAIL

Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox

Extras is designed to augment the existing settings and configuration. You could also use ./extra.ps1 to override settings, functions and aliases from my dotfiles repository, but it is probably better to fork this repository.

Sensible Windows defaults

When setting up a new Windows PC, you may want to set some Windows defaults and features, such as showing hidden files in Windows Explorer. This will also set your machine name and full user name, so you may want to modify this file before executing.

.\windows.ps1

Install dependencies and packages

When setting up a new Windows box, you may want to install some common packages, utilities, and dependencies. These could include node.js, Chocolatey packages, Windows Features and Tools via Web Platform Installer, and Visual Studio Extensions from the Visual Studio Gallery.

.\deps.ps1

The scripts will install Chocolatey, node.js, ruby and python if necessary.

Visual Studio Extensions
Extensions will be installed into your most current version of Visual Studio. You can also install additional plugins at any time via Install-VSExtension $url. The Url can be found on the gallery; it's the extension's Download link url.

Forking your own version

If you do fork for your own custom configuration, you will need to touch a few files to reference your own repository, instead of mine.

Within /setup/install.ps1, modify the Repository variables.

$account = "leonelgalan"
$repo    = "dotfiles-windows"
$branch  = "master"

Within the Windows Defaults file, /windows.ps1, modify the Machine name on the first line.

(Get-WmiObject Win32_ComputerSystem).Rename("MyMachineName") | Out-Null

Finally, be sure to reference your own repository in the git-free installation command.

iex ((new-object net.webclient).DownloadString('https://raw.github.com/$account/$repo/$branch/setup/install.ps1'))

Feedback

Suggestions/improvements are welcome and encouraged!

Original Author

![twitter/leonelgalan]https://s.gravatar.com/avatar/fd50f61387b63900335c8556f86237be?s=70)
Leonel Galan

Thanks to…

dotfiles-windows's People

Contributors

jayharris avatar leonelgalan avatar ppejovic avatar

Watchers

 avatar  avatar

dotfiles-windows's Issues

Fail to update help 1909

> .\deps.ps1
Updating Help...
Update-Help : Failed to update Help for the module(s) 'PSReadline, WindowsUpdateProvider' with UI culture(s) {en-US} :
Unable to retrieve the HelpInfo XML file for UI culture en-US. Make sure the HelpInfoUri property in the module
manifest is valid or check your network connection and then try the command again.
At C:\Users\leonelgalan\Documents\WindowsPowerShell\deps.ps1:14 char:1
+ Update-Help -Force
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [Update-Help], Exception
    + FullyQualifiedErrorId : UnableToRetrieveHelpInfoXml,Microsoft.PowerShell.Commands.UpdateHelpCommand

Registry Mismatch in 1909

> .\windows.ps1
Configuring Privacy ...
Set-ItemProperty : Cannot find path
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener'
because it does not exist.
At C:\Users\leonelgalan\Documents\WindowsPowerShell\windows.ps1:87 char:1
+ Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Cap ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKCU:\SOFTWARE\...icationListener:String) [Set-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetItemPropertyCommand

Set-ItemProperty : Cannot find path
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics' because it does
not exist.
At C:\Users\leonelgalan\Documents\WindowsPowerShell\windows.ps1:132 char:1
+ Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Cap ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKCU:\SOFTWARE\...\appDiagnostics:String) [Set-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetItemPropertyCommand

Set-ItemProperty : Cannot find path
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\documentsLibrary' because it
does not exist.
At C:\Users\leonelgalan\Documents\WindowsPowerShell\windows.ps1:136 char:1
+ Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Cap ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKCU:\SOFTWARE\...ocumentsLibrary:String) [Set-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetItemPropertyCommand

Set-ItemProperty : Cannot find path
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\broadFileSystemAccess' because
it does not exist.
At C:\Users\leonelgalan\Documents\WindowsPowerShell\windows.ps1:147 char:1
+ Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Cap ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKCU:\SOFTWARE\...ileSystemAccess:String) [Set-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetItemPropertyCommand

Set-ItemProperty : Cannot find path
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\radios' because it does not
exist.
At C:\Users\leonelgalan\Documents\WindowsPowerShell\windows.ps1:169 char:1
+ Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Cap ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKCU:\SOFTWARE\...entStore\radios:String) [Set-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetItemPropertyCommand

Set-ItemProperty : Cannot find path
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userDataTasks' because it does
not exist.
At C:\Users\leonelgalan\Documents\WindowsPowerShell\windows.ps1:173 char:1
+ Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Cap ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKCU:\SOFTWARE\...e\userDataTasks:String) [Set-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetItemPropertyCommand

Set-ItemProperty : Cannot find path
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync' because it does
not exist.
At C:\Users\leonelgalan\Documents\WindowsPowerShell\windows.ps1:180 char:1
+ Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Cap ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKCU:\SOFTWARE\...e\bluetoothSync:String) [Set-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetItemPropertyCommand

Error installing webpi 1909

webpi v5.0 - Possibly broken
webpi package files install completed. Performing other installation steps.
Attempt to get headers for http://go.microsoft.com/fwlink/?LinkId=255386 failed.
  The remote file either doesn't exist, is unauthorized, or is forbidden for url 'http://go.microsoft.com/fwlink/?LinkId=255386'. Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (404) Not Found."
Downloading webpi
  from 'http://go.microsoft.com/fwlink/?LinkId=255386'
ERROR: The remote file either doesn't exist, is unauthorized, or is forbidden for url 'http://go.microsoft.com/fwlink/?LinkId=255386'. Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (404) Not Found."
The install of webpi was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\webpi\tools\chocolateyInstall.ps1'.
 See log for details.

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - webpi (exited 404) - Error while running 'C:\ProgramData\chocolatey\lib\webpi\tools\chocolateyInstall.ps1'.
 See log for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.