Repository navigation
Fix set-content failure on Linux for creating file in psdrive. (#2206) - #2392
Conversation
|
Hi Charu Bassi (@charub), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
|
That seems to interfere with #2325 |
23b9696 to
dbb7255
Compare
|
James Truher (@JamesWTruher) : Please have a look |
dbb7255 to
bd0fa40
Compare
There was a problem hiding this comment.
$SkipNotAdmin = $windowsPrincipal.IsInRole("Administrators") -eq $false [](start = 12, length = 71)
we have a new allowed tag: RequireAdminOnWindows which is applicable to a Describe block
the test below can be moved to it's own describe block and tagged with RequireAdminOnWindows
(see New-Item.Tests.ps1)
There was a problem hiding this comment.
I wanted to keep the logically similar tests in the same describe block, that's why I used $SkipNotAdmin instead of RequireAdminOnWindows.
There was a problem hiding this comment.
The test architecture is that tests which require admin will only be run if the tag is proper. This test has to be tagged properly or it won't ever be run. Because of that, you need to put it in it's own Describe block, even if it does not make sense logically
There was a problem hiding this comment.
created another describe block to accomodate the test which require admin privileges.
a06b87d to
5980c1b
Compare
There was a problem hiding this comment.
I'm not sure whether set-content -passthru actually retrieves the data from the file - would an explicit call to get-content be better?
There was a problem hiding this comment.
Removing passthru and retrieving the content using get-content cmdlet
There was a problem hiding this comment.
Describe [](start = 0, length = 8)
thanks!
Resolving PowerShell#2206 Set-Content fails to create a file for PSDrive path, if the path root begins with defaultPathSeperatorString (ex: UNC path and paths in Single rooted filesystems like Unix)
5980c1b to
43cfb32
Compare
|
|
|
Hi Charu Bassi (@charub), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
TTYL, MSBOT; |
|
close and re-open to trigger the CIs. |
Resolving PowerShell#2206 Set-Content fails to create a file for PSDrive path, if the path root begins with defaultPathSeperatorString (ex: UNC path and paths in Single rooted filesystems like Unix)
Resolving #2206
Following scenario failed on Linux:
new-psdrive -name TESTDRIVE -root /home/user1/test -psprovider FileSystem
'abc' | set-content -path TESTDRIVE:/testfile.txt
Set-Content fails to create a file for PSDrive path, if the path root begins with defaultPathSeperatorString (ex: UNC path and paths in Single rooted filesystems like Unix)