An early thought is that you have a custom PS repository that is getting in the way. Run get-psrepository
to see if there are any repos registered other than PSGallery. Next I might recommend you pass the -Verbose
flag as part of your profile call to see what is potentially going on.
You shouldn't need to specify the -Scope global
or -global
parameters for the command as this is the default when called from a script or the command line already. This shouldn't be the cause of your issue but just one less thing to worry about.
The second thing I wonder about is a bad module. Run Get-Module Web*
to see what the actual module is and ensure it is the correct version and contains the correct commands. If it doesn't then install it again. Normally, I believe, this is installed as part of IIS features when you install the Management Tools for IIS. You can confirm this using Get-Module -ListAvailable
.
I should also note that it generally isn't necessary to call Import-Module
anymore. As of PS 3 if a module is installed then PS will auto load it when you use a command the first time from it. Thus explicit imports are only necessary for modules that haven't already been installed before.