2

I am using a regular system, nothing virtual, my C drive is not mapped which I see in some forums. Environment path not set?

I started a tutorial to learn Powershell, and the first thing I tried to execute was very simple:

PS C:\Users\user> get-help get

Error I receive:

get-help : Cannot find drive. A drive with the name '.C' does not exist.
At line:1 char:1
+ get-help get
+ ~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (.C:String) [Get-Help], DriveNotFoundException
    + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetHelpCommand

Image: enter image description here


System:
Windows7, Powershell 4.0, .NET 4.5

11
  • Notice how it says .C. That's certainly not what a valid drive letter looks like. Did you make any changes that could have caused this?
    – Daniel B
    Jan 3 '16 at 22:46
  • Have you changed any of the powershell config files? For example C:\Users\{username}\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1?
    – DavidPostill
    Jan 3 '16 at 22:51
  • @DavidPostill All I did was install the required files from the microsoft website and tried to execute this line. I did not configure anything or touch any files that were installed. Simply run(cmd) then powershell just as the image demonstrates. Nothing else.
    – ejbytes
    Jan 3 '16 at 23:02
  • General: What is with the down voting? Someone is on a spree of bad manners today. I checked out the question board and there are like 20 -1's in a row. Someone had too much to drink I think. Something wrong with the way I posed this question? Please do comment.
    – ejbytes
    Jan 3 '16 at 23:03
  • @ejbytes Did you reboot after installing? I recall mine misbehaving after installing version 4.0 (it displayed the wrong version number until I rebooted).
    – DavidPostill
    Jan 3 '16 at 23:06
1

So it seems that I had a bug in my Environment Variables, Path. Here is the screen shot of what I changed.
enter image description here


After trying to reboot and fail. Uninstalled .NET, reinstalled .NET, reinstalled a Powershell version and still fail. I ended up checking my Environment Variables. I had changed them a few years ago per a "fix" for JUNIT testing in Java programming.

0

get-help : Cannot find drive. A drive with the name '.C' does not exist.

Your PowerShell installation is broken or mis-configured.

It should produce output similar to the following:

PS C:\Windows\System32\WindowsPowerShell\v1.0> get-help get

Name                              Category  Module                    Synopsis
----                              --------  ------                    --------
Get-Verb                          Function
Get-FileHash                      Function  Microsoft.PowerShell.U... ...
Get-Command                       Cmdlet    Microsoft.PowerShell.Core ...
Get-Module                        Cmdlet    Microsoft.PowerShell.Core ...
Get-Help                          Cmdlet    Microsoft.PowerShell.Core ...
Get-History                       Cmdlet    Microsoft.PowerShell.Core ...
Get-PSSessionConfiguration        Cmdlet    Microsoft.PowerShell.Core ...
Get-PSSession                     Cmdlet    Microsoft.PowerShell.Core ...
...
3
  • I realized that this is the desired output. It's a fresh install. What would cause this error?
    – ejbytes
    Jan 3 '16 at 22:59
  • @ejbytes Have you changed any of the powershell config files? For example C:\Users\{username}\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
    – DavidPostill
    Jan 3 '16 at 23:00
  • No. I didn't configure anything. I am a noob for Powershell and Admin functions.
    – ejbytes
    Jan 3 '16 at 23:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.