Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

*-Item should handle files with wildcard characters #2799

Copy link
Copy link
@JamesWTruher

Description

@JamesWTruher
Issue body actions

Steps to reproduce

Describe "Rename-Item" {
    It "Rename-Item should work with files which have special characters" {
        $file = new-item -itemtype file "${TESTDRIVE}/file[txt].txt"
        test-path -literal $file.fullname | Should be $true
        Rename-Item -literal $file.fullname "${TESTDRIVE}/file.txt.txt"
        test-path -literal $file.fullname | Should be $false
        test-path -literal "${TESTDRIVE}/file.txt.txt" | should be $true
    }
}

Expected behavior

this test should pass (and it does on Windows)

Actual behavior

Rename-Item can't seem to find the file

Describing Rename-Item
 [-] Rename-Item should work with files which have special characters 1.41s
   An object at the specified path /tmp/bc945451-748f-471e-8dab-f2d09a1b2221/file[txt].txt does not exist.
   at line: 5 in /home/james/tmp/rename.item.tests.ps1
Tests completed in 1.41s
Passed: 0 Failed: 1 Skipped: 0 Pending: 0

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.13-10-g7015e66baecc02955640b5c19e7feb5cb6746c63
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
uname -a
Linux jimtru-ub16d 4.4.0-47-generic #68-Ubuntu SMP Wed Oct 26 19:39:52 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productOS-LinuxResolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.