Commit graph

91 commits

Author SHA1 Message Date
PowerShell Team 22d2273ce4 Refactoring - use ?? in more places 2016-08-03 12:14:28 -07:00
PowerShell Team 85d6e9f022 Refactoring - adjust modifiers declaration order 2016-08-03 12:14:28 -07:00
PowerShell Team ae8d2ed794 Refactor - convert to auto-property
Mostly using R# to automatically refactor, with some manual
fixups where it wouldn't work automatically (e.g. xml comments
on fields) or some it seemed to miss.

Some minor code reformatting was also done on properties near
other stuff I was manually inspecting.
2016-08-03 12:14:28 -07:00
PowerShell Team bc4901bd59 Remove unused using statements 2016-08-03 12:06:06 -07:00
PowerShell Team 403ae3f53f Initial run of code formatter
I (Jason Shirk) ran https://github.com/dotnet/codeformatter with the default rules, basically:

    codeformatter /nocopyright "/c:DEBUG,UNIX,CORECLR" @files.rsp

This caused a few problems building, which were fixed up manually.

Notable changes:

`this.` is removed unless needed to disambiguate.
private instance fields are renamed to have a `_` prefix.
private static fields are renamed to have a `s_` prefix.

I left some projects alone (like PackageManagement) and also left some generated code alone.
2016-08-01 15:57:03 -07:00
Sergei Vorobev a704a53f08 Make Get-Item env: case-aware on Unix
Fix #1196
2016-07-28 14:19:36 -07:00
Jason Shirk (POWERSHELL) 673dd2c355 Change preprocessor macro LINUX to UNIX 2016-07-22 10:49:45 -07:00
Andrew Schwartzmeyer 35e24ce6d4 Clean up CreateSymLink() 2016-07-14 17:34:12 -07:00
Andrew Schwartzmeyer a9484e45e9 Remove Platform.SupportsRemoveDrive query 2016-07-14 17:34:12 -07:00
Andrew Schwartzmeyer dbe16ca5d7 Remove Platform.SupportsReparsePoints query 2016-07-14 17:34:12 -07:00
Andrew Schwartzmeyer 465e55d32a Remove Platform.HasNetworkDriveSupport query 2016-07-14 17:34:12 -07:00
Andrew Schwartzmeyer ab882cb04d Remove Platform.UseDotNetToQueryFileAttributes query 2016-07-14 17:34:12 -07:00
Andrew Schwartzmeyer 2249afcd0a Remove Platform.HasUNCSupport query 2016-07-14 17:34:12 -07:00
Andrew Schwartzmeyer 527f30a013 Remove Platform.HasSingleRootFilesystem query 2016-07-14 17:34:12 -07:00
Andrew Schwartzmeyer 73a1a51f69 Remove Platform.HasRegistry query 2016-07-14 17:34:12 -07:00
Andrew Schwartzmeyer 4e518fe1c7 Remove Platform class override of PlatformNotSupportedException
This was confusing and unused in most places, exception itself removed
in cleanup.
2016-07-14 17:34:12 -07:00
Andrew Schwartzmeyer 50e6627a8e Throw PlatformNotSupported on Windows .NET Core build 2016-07-08 14:08:22 -07:00
Andrew Schwartzmeyer 6200f084cd Invoke-Item and Get-Help -Online are unsupported on Nano
These currently fail at runtime on Nano, and will continue to do so. But
this implements these much needed cmdlets for Open PowerShell.

If there is a way to determine that PowerShell is being run on the Nano
OS at runtime, then we could instead throw a platform unsupported
exception, but this cannot be based on the target compilation framework,
as .NET Core is shared for both Nano and Windows.
2016-07-08 13:48:36 -07:00
Andrew Schwartzmeyer ef2ba40ca7 Use start in Invoke-Item to open items on Windows
Since `UseShellExecute` cannot be used.
2016-07-08 13:48:36 -07:00
Alex Jordan aefeb80108 Fixed scope issue in invokeitem 2016-07-05 18:20:02 -07:00
Alex Jordan e580941667 UseShellExecute moved to OS guards for Invoke-Item 2016-07-05 16:05:58 -07:00
Alex Jordan fd7a16778c Fixed unknown char in comments
Cosmetic change.
2016-06-29 10:52:56 -07:00
Alex Jordan eec3b334cc Adding logic for invoke-item for non-Windows OSes 2016-06-29 10:52:56 -07:00
Andrew Schwartzmeyer b30aabc12b Revert string comparison changes
These comparisons did not need to be changed as the input path is not
modified. The normalized relate path created from the stack (if this
code path is taken) is created with the correct path separators.
2016-06-15 12:16:54 -07:00
Andrew Schwartzmeyer d162437b7b Remove string literals in registry provider 2016-06-15 12:16:54 -07:00
Andrew Schwartzmeyer 3262a4b3ec Fix GetDriveQualifiedPath for single root filesystems
Reverted to original code and fixed correctly.
2016-06-15 12:16:54 -07:00
Andrew Schwartzmeyer 3464f9aee3 Fix ExpandMshGlobPath for single root filesystems
Reverted to original code and fixed correctly.
2016-06-15 12:16:54 -07:00
Andrew Schwartzmeyer ee40426fb3 Fix path root comparisons for Linux
Assuming the path may not be normalized, to make PowerShell slash
agnostic in a filesystem whose "drive" is a '/' and a 'C:\', we need to
compare to both '/' and '\' for users of PowerShell's alternate path
separator on Linux ('\').
2016-06-15 12:16:54 -07:00
Andrew Schwartzmeyer 047525aa9d Revert unnecessary changes 2016-06-14 16:21:17 -07:00
Andrew Schwartzmeyer 69ce0e7107 Revert CORECLR guard from FullCLR files
This reverts the `if !CORECLR ... #endif` guard surrounding FullCLR
files by applying the original diff from the `source-depot` branch, thus
the accidentally overwritten BOMs were restored as well.
2016-06-14 16:06:48 -07:00
PowerShell Team d9bf6b037f Update files from Source Depot changeset [SD:704605]
Corresponds to 75764b265885c1a346d1b2dbcb281d61b71c5b31 in psl-monad.
2016-05-18 17:41:26 -07:00
George Fleming b87c026bbe Fix spelling 2016-04-28 09:01:26 -07:00
George Fleming 967634f732 Don't ask for Linux 2016-04-28 08:44:20 -07:00
George Fleming a8f4fb8a07 For Symlinks to directories, fix Windows error on removal, and asking confirmation on Linux 2016-04-28 08:44:20 -07:00
Andrew Schwartzmeyer 3a43126a2e Allow creation of symlink to non-existent target
This action is completely valid on both Windows and Linux (and OS X)
operating systems; tested with `mklink` and `ln -s` respectively.

Note that targets for hard links must exist, thus we check specifically
for symbolic links.

Both the path globber in session state and the `New-Item` implementation
needed to be fixed to allow the target not to exist.

Resolves #801.

Also enable symbolic link tests on Windows.
2016-04-09 18:45:23 -07:00
Andrew Schwartzmeyer f5410a18ce Replace IsWindows method with property
And add *correct* IsLinux and IsOSX properties.
2016-04-08 14:54:41 -07:00
Andrew Schwartzmeyer 6f2110f38a Replace use of IsLinux with IsWindows
So that IsLinux can stop being overloading for OS X.
2016-04-08 14:50:37 -07:00
PowerShell Team 78a18c3f70 Revert "Update files from psl-monad"
This reverts commit 9ed2c2a68b.
This commit is here to make source-depot branch a parent of master
2016-04-06 12:03:50 -07:00
PowerShell Team 9ed2c2a68b Update files from psl-monad
This commit uses psl-monad branch source-depot 28156300
And corresponds to [SD:692351]
2016-04-06 11:55:18 -07:00
PowerShell Team 45140c5752 Move files from psl-monad submodule to super-project
This commit uses master branch 860eb5d
2016-03-30 20:01:33 -07:00
PowerShell Team 60b3b304f2 Move files from psl-monad submodule to super-project
This commit uses psl-monad branch source-depot 7209cb9
And corresponds to [SD:688741]
2016-03-30 17:16:23 -07:00