PowerShell

The PowerShell forum accepts bug reports as well as feedback and suggestions. For more information, check out the PowerShell Homepage

The following is a list of the states we use to track items.

status meaning
survey We saw this and we are considering it. Please upvote if it’s important to you.
needs more information We don’t understand the issue and need additional details.
investigating We are looking at this internally to understand things like: scenario, reproduction of issue, costing, or other technical details.
in queue The issue is understood and in our unprioritized backlog. Your votes will be used to drive prioritization of this work.
  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. Cannot specify remote filename when calling Copy-Item with -ToSession

    The use case is copying a local file to a remote server using PowerShell remoting and Copy-Item:

    $remote = "aremotemachine.example.com"
    $cred = Get-Credential
    $session = New-PSSession -ComputerName $remote -Credential $cred
    echo "testcontent" > testfile.txt

    # Works when we only specify a destination directory
    Copy-Item -Path testfile.txt -Destination C:\ -ToSession $session

    # Doesn't work when we specify a filename
    Copy-Item -Path testfile.txt -Destination C:\testfile.txt -ToSession $session

    # Even if it's different from the original filename
    Copy-Item -Path testfile.txt -Destination C:\testfile2.txt -ToSession $session

    # Here is the output I get for the first failed command
    Copy-Item : Destination folder 'C:\testfile.txt' does not…

    5 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
  2. Bug: Get-Module -List throws if an installed module uses Import-Module with $PSScriptRoot

    In WMF 5.0 (tested on Win7 w/ KB3134760 and Win10 10240), the presence of certain Import-Module statements in a module in $env:PSModulePath will cause Get-Module -List to throw. In particular, if a module attempts to import another module with a path relative to $PSScriptRoot, it seems to break things. We do this type of thing within psm1s in cases where a manifest cannot express the behavior we need. Here's a repro:

    ## On Win7, using the re-released WMF 5.0 (KB3134760):

    PS C:\> $PSVersionTable

    Name Value
    ---- -----
    PSVersion 5.0.10586.117
    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
    BuildVersion 10.0.10586.117
    CLRVersion 4.0.30319.42000
    WSManStackVersion 3.0 …

    2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    2 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →

    Hi Matt,

    A lot of this code has since been rewritten to fix problems like this. I’m followed your steps very particularly on the latest internal build, and I can’t seem to get it to repro.

    I understand you’re using WMF 5 on Windows 7, but if you’ve got a test machine lying around, I highly encourage you to see if the Windows Insider build fixes your problem.

    Either way, this should be fixed in a future version of Windows 10 (and potentially WMF as well).

    Thanks,
    Joey

  • Don't see your idea?

Feedback and Knowledge Base