Powershell 7 function issue
trying to make my first PWSH profile and am working on functions and alias, trying to figure out why one I created isn't working...
I am trying to use notepad++ instead of notepad, I copied what I believe is notepads function I found online it reads
function open.txt {
param (
[string]$FilePath )
Start-Process notepad++.exe -ArgumentList $FilePath }
replace open.txt with notepad for original text
when i open terminal in a folder that has a text file it works fine but when i use the cmd
open.txt $PROFILE.AllUsersAllHosts
I get
Cannot open file
"C\Users\Admin\Desktop\Files\Powershell\7\profile.ps1|" cannot be opened:
Folder "C\Users\Admin\Desktop\Files\Powershell\7\profile.ps1|" doesn't exist.
and it opens notepad++ with a file labeled C:\Program
yet cmd
"notepad $PROFILE.AllUsersAllHosts"
opens it just fine
2 Replies
Discord
Markdown Text 101 (Chat Formatting: Bold, Italic, Underline)
Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to d...
are you sure that's not just a typo?
looks like it's trying to open
profile.ps1| rather than profile.ps1