Comments (4)
@ChrisTitusTech the -ne "True"
is not required at all and breaks on most peoples setups (including mine)
So, instead you should remove those args and then do a boolean negation with the !
operator instead.
You should also lowercase the If
to if
. Then, your logic will work flawlessly on all machines :)
from powershell-profile.
so, this is an easy fix
You can either fix this yourself - or use this pull request
Download the scrpt, or copy the contents into a .ps1
file onto your machine and modify the script with the below code
Completely replace the first if-statement with this:
#If the file does not exist, create it.
if (!(Test-Path -Path $PROFILE -PathType Leaf)) {
try {
# Detect Version of Powershell & Create Profile directories if they do not exist.
if ($PSVersionTable.PSEdition -eq "Core" ) {
if (!(Test-Path -Path ($env:userprofile + "\Documents\Powershell"))) {
New-Item -Path ($env:userprofile + "\Documents\Powershell") -ItemType "directory"
}
}
elseif ($PSVersionTable.PSEdition -eq "Desktop") {
if (!(Test-Path -Path ($env:userprofile + "\Documents\WindowsPowerShell"))) {
New-Item -Path ($env:userprofile + "\Documents\WindowsPowerShell") -ItemType "directory"
}
}
Invoke-RestMethod https://github.com/ChrisTitusTech/powershell-profile/raw/main/Microsoft.PowerShell_profile.ps1 -o $PROFILE
Write-Host "The profile @ [$PROFILE] has been created."
}
catch {
throw $_.Exception.Message
}
}
Then simply call the script ./setup.ps1
or whatever you called it.
from powershell-profile.
Thanks
from powershell-profile.
Merged #17
from powershell-profile.
Related Issues (20)
- Web request status endless loop
- Endlessly Promping during Installation HOT 2
- installation issue..... HOT 1
- Installation broke HOT 6
- InvalidOperation: The script failed due to call depth overflow.
- Test-Connection errors HOT 2
- Changes made to the profile are discarded after a restart
- A parameter cannot be found that matches parameter name 'TimeoutSeconds'. HOT 1
- Suggestion about Oh-My-Posh config change HOT 1
- edit-profile does not point to $profile HOT 3
- Delete command from curl
- A few issues when running the install...
- Test-connection -TimeSeconds parameter not recongnized (NamedParameterNotFound) HOT 4
- Fonts ZIP file missing in installation folder? HOT 3
- Bitdefender blocking install HOT 1
- Suggestion add fastfetch on startup
- Lost personal configuration when update HOT 4
- Nothing happens after install HOT 4
- Fail on Test-Connection HOT 3
- Loading personal and system profiles takes around 10 seconds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powershell-profile.