Powershell problem, cannot change directory

ANTONIO ACQUASANTA 1 Reputation point

So hi everyone! I am new here, and I arrived because of a problem I am having with the powershell. Basically it seems very reluctant at executing Powershell commands, for example for the Set-Location command to change directory. I tried to put "" and later '' on the path, putting and removing the -Path appendix, anything, but it is not executing the command. And plus, it does not even show an error it just doesn't do anything. I added Powershell before the command, because otherwise it was giving me an error regarding not understanding what the command was, hence suggesting that now that the error is gone it knows what command is but cannot execute it. I really need for obvious reasons that this command works ahah! So if anybody could give some hints would be amazing, but for now thank even just for reading! Have a good one,

Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,002 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,414 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Alistair Ross 7,101 Reputation points Microsoft Employee

    Can you share what you are doing, most likely a syntax issue but without seeing it, it is hard to diagnose


    1 person found this answer helpful.

  2. MotoX80 32,326 Reputation points

    I'm stuck in the user directory.

    You're in a command prompt and running Powershell and telling it to execute a command. PS runs the command and then terminates. That leaves you back in the command prompt and whatever directory that it has set.

    Just run powershell. Then in the "PS prompt" enter the commands.


    1 person found this answer helpful.
    0 comments No comments

  3. ANTONIO ACQUASANTA 1 Reputation point

    Oh wow thanks a lot it is now moving from one directory to another! I may ask another thing and then quit, now if I ls the directory I finally got in, I receive an error message for not having the permission182552-accessonegatojpeg.gif
    Besides asking for this error, clearly I have not a clear idea of what the powershell is doing, can you suggest me a reading or a topic for understaning it? How does it differentiate from the linux shell? I need to learn this stuff. Thank you a lot again!

    0 comments No comments

  4. MotoX80 32,326 Reputation points

    Powershell is Microsoft's shell solution to replace the original command prompt, cmd.exe. You will find many common Linux shell commands are avaiable. These are aliases to PS cmdlets. If you just run Powershell from the Windows start menu it will open and the default directory will be your user account's home directory. From there your ls command should work. If not, then you've done something with accounts or directory permissions. I have no way of knowing what you did.

    You can list the aliases like this.

    PS C:\Users\madne> get-alias
    CommandType     Name                                               Version    Source
    -----------     ----                                               -------    ------
    Alias           % -> ForEach-Object
    Alias           ? -> Where-Object
    Alias           ac -> Add-Content
    Alias           asnp -> Add-PSSnapin
    Alias           cat -> Get-Content
    Alias           cd -> Set-Location
    Alias           CFS -> ConvertFrom-String                    Microsoft.PowerShell.Utility
    Alias           chdir -> Set-Location
    Alias           clc -> Clear-Content
    Alias           clear -> Clear-Host
    Alias           clhy -> Clear-History
    Alias           cli -> Clear-Item
    Alias           clp -> Clear-ItemProperty
    Alias           cls -> Clear-Host
    Alias           clv -> Clear-Variable
    Alias           cnsn -> Connect-PSSession
    Alias           compare -> Compare-Object
    Alias           copy -> Copy-Item
    Alias           cp -> Copy-Item
    Alias           cpi -> Copy-Item
    Alias           cpp -> Copy-ItemProperty
    Alias           curl -> Invoke-WebRequest
    Alias           cvpa -> Convert-Path
    Alias           dbp -> Disable-PSBreakpoint
    Alias           del -> Remove-Item
    PS C:\Users\madne> get-help ls
        Gets the items and child items in one or more specified locations.
        Get-ChildItem [[-Filter] <System.String>] [-Attributes {Archive | Compressed | Device | Directory | Encrypted |
        Hidden | IntegrityStream | Normal | NoScrubData | NotContentIndexed | Offline | ReadOnly | ReparsePoint |
        SparseFile | System | Temporary}] [-Depth <System.UInt32>] [-Directory] [-Exclude <System.String[]>] [-File]
        [-Force] [-Hidden] [-Include <System.String[]>] -LiteralPath <System.String[]> [-Name] [-ReadOnly] [-Recurse]
        [-System] [-UseTransaction] [<CommonParameters>]
        Get-ChildItem [[-Path] <System.String[]>] [[-Filter] <System.String>] [-Attributes {Archive | Compressed | Device
        | Directory | Encrypted | Hidden | IntegrityStream | Normal | NoScrubData | NotContentIndexed | Offline | ReadOnly
        | ReparsePoint | SparseFile | System | Temporary}] [-Depth <System.UInt32>] [-Directory] [-Exclude
        <System.String[]>] [-File] [-Force] [-Hidden] [-Include <System.String[]>] [-Name] [-ReadOnly] [-Recurse]
        [-System] [-UseTransaction] [<CommonParameters>]
        The `Get-ChildItem` cmdlet gets the items in one or more specified locations. If the item is a container, it gets
        the items inside the container, known as child items. You can use the Recurse parameter to get items in all child
        containers and use the Depth parameter to limit the number of levels to recurse.

    For more info see:



    0 comments No comments