From cfc643ca48e6c0f9efaee71c6cd669ba341e3c06 Mon Sep 17 00:00:00 2001 From: xa0082249956 <576810415@qq.com> Date: Wed, 1 Dec 2021 20:18:14 +0800 Subject: [PATCH 1/2] add PowerShell support --- mother.ps1 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 mother.ps1 diff --git a/mother.ps1 b/mother.ps1 new file mode 100644 index 0000000..071c16b --- /dev/null +++ b/mother.ps1 @@ -0,0 +1,28 @@ +$script:ErrorActionPreference = 'SilentlyContinue' + +# pip +'pip', 'pip3' | ? { Get-Command $_ } | % { + & $_ list --disable-pip-version-check --format json | ConvertFrom-Json | % { & $_ uninstall -y $_.Name} +} + +# npm +'npm' | ? { Get-Command $_ } | % { + & $_ cache verify + & $_ cache clean --force + & $_ uninstall * +} +Remove-Item -Recurse -Force node_modules, package.json + +# PowerShell +Get-InstalledModule | Remove-Module +Remove-Item -Force $PROFILE + +# dotfiles +Remove-Item -Recurse -Force ~/.nuget, ~/.bashrc, ~/.zscrc, ~/. + +# Show message +if ($PSVersionTable.PSEdition -eq 'Desktop' -or $IsWindows) { + Add-Type -AssemblyName System.Windows.Forms + [System.Windows.Forms.MessageBox]::Show('您配吗?') +} +Write-Host '您配吗?' -ForegroundColor Magenta From 009baac1b449b14a39b80456a878e8a50cba84c0 Mon Sep 17 00:00:00 2001 From: xa0082249956 <576810415@qq.com> Date: Wed, 1 Dec 2021 20:22:14 +0800 Subject: [PATCH 2/2] Do not clean profile --- mother.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mother.ps1 b/mother.ps1 index 071c16b..34e9bd5 100644 --- a/mother.ps1 +++ b/mother.ps1 @@ -11,14 +11,13 @@ $script:ErrorActionPreference = 'SilentlyContinue' & $_ cache clean --force & $_ uninstall * } -Remove-Item -Recurse -Force node_modules, package.json +Remove-Item -Recurse -Force node_modules # PowerShell Get-InstalledModule | Remove-Module -Remove-Item -Force $PROFILE # dotfiles -Remove-Item -Recurse -Force ~/.nuget, ~/.bashrc, ~/.zscrc, ~/. +Remove-Item -Recurse -Force ~/.nuget # Show message if ($PSVersionTable.PSEdition -eq 'Desktop' -or $IsWindows) {