I am trying to load a PowerShell module that executes a custom cmdlet function but I can't get it to load... I've applied the solutions of several previous questions, but now I'm just going in circles. Here are the specs of what I have done so far and the specific error that returns. Note that as I am new to PowerShell and programming in general, it wouldn't surprise me that my problem isn't a file path issue but a logic error in my actual function:
I created a profile function for a custom cmdlet that allows me to open project files from two different paths:
function push-project( $project ) { pushd ~/Documents/Visual Studio 2015/Projects/$project; pushd ~/Documents/GitHub/$project; } New-Alias -Name pp -Value push-project;
I created a module by saving the function as
ProfileFunctions.psm1
in the following directory:~\Documents\WindowsPowerShell\Modules\ProfileFunctions\ProfileFunctions.psm1
To invoke the function, per its syntax, I type in
pp $projectName
into the PS console window, but the error that returns is standard not recognized:pp : The term 'pp' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1
- pp MyFirstApp
- ~~
- CategoryInfo : ObjectNotFound: (pp:String) [], CommandNotFoundException
- FullyQualifiedErrorId : CommandNotFoundException