Commit Graph
1761 Commits
Author SHA1 Message Date
nitinbps f4c1569421 Get-ChildItem -Recurse -ErrorAction Ignore doesn't ignore the errors (#2503)
Get-ChildItem -Recurse -ErrorAction Ignore doesn't ignore the errors for some specific files under a folder and instead terminate the pipeline.
2016-11-02 11:26:51 -07:00
Charu Bassi 85825e2b0b Fix Resolve-Path -LiteralPath for drive paths (#2572)
Resolving #2570.
Ignore drive paths in the check. If the input is a drive path,
then "\" is passed as the path to GetDriveQualifiedPath with drive info.
Since, the path here starts with "\", treatAsRelative is set to false
which prevents further formatting of this path.
The check is only valid for PSDrives with root path equals to UNC paths or the paths
in unix.
2016-11-01 18:01:52 -07:00
Jason Shirk (POWERSHELL) f65312dbc0 Don't block pipeline when running windows exes 2016-11-01 14:15:31 -07:00
Paul Higinbotham 24f3b75549 Fix for PowerShell SSH remoting with recent Win32-OpenSSH change. (#2538)
* Fix for Win32-OpenSSH break when hosting PowerShell in server mode as an SSH subsystem.

* Refactored to use null PSHostUserInterface implementation

* Implemented code review comments
2016-11-01 13:02:31 -07:00
iSazonov 5aee4ba85e Fix Select-Object to approve UX and fix return a property named * (#2421)
There are mainly 2 changes:
1. When '-ExcludeProperty' is specified but '-Property' is not, use "*" as the default value for '-Property'.
2. Allow 'Select-Object -Property noexist-name' to return a PSObject with property noexist-name, unless noexist-name itself contains wildcards.
2016-11-01 10:04:44 -07:00
iSazonov cef0c54157 Fix Get-Alias Name parameter allows Null value (#2545)
1. Add [ValidateNotNullOrEmpty()] to Name parameter
2. Add tests
2016-10-31 17:19:25 -07:00
Steve Lee 44eb20dc8f Fixes #2534 by replacing expensive WMI query with Win32 API calls (#2535)
* Fixes #2534 by replacing expensive WMI query with Win32 API calls

* fix break on unix build

* added tests for #2535

* although test passed, fixing exception that shows up

* fixed Describe text

* addressing code review feedback

* addressing review feedback to comment on why sleep is needed
added check that test processes are created before we try to kill them

* fixed test to timeout and pending fix for #2561
2016-10-31 09:41:13 -07:00
Dongbo Wang e09ddc494c Further update the tests and product code to fix test failures 2016-10-28 16:51:44 -07:00
Dongbo Wang 53d0345911 Enable implicit remoting cmdlets in PowerShell Core 2016-10-28 16:51:44 -07:00
Charu Bassi ee2feaa827 Fix set-content failure for creating file in psdrive. (#2392)
Resolving #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)
2016-10-28 14:31:02 -07:00
Hemant Mahawar 67638548fc Add ValidateNullOrEmpty to -Name parameter of Get-Service (#2542)
* Adding validation to Get-Service -Name parameter
2016-10-27 16:37:50 -07:00
iSazonov baeec066d9 Add support <Suppress> in Get-WinEvent -FilterHashtable (#2506)
* Add support <Suppress> in Get-WinEvent -FilterHashtable

1. Add support <Suppress>
2. Refacrtoring BuildStructuredQueryFromHashTable() to use StringBuilder
3. Add tests

* Changelog
2016-10-27 14:54:14 -07:00
Mike Richmond a659a95a00 Fixing the plugin install directory to refect the current version (#2539) 2016-10-26 15:25:09 -07:00
Dongbo Wang 9ec8baea79 Add '<Link>' tag to '<Compile>', '<None>' and '<EmbeddedResource>' tags to make those items look similar as when the *.csproj files were in the original project folders. (#2519) 2016-10-21 17:04:05 -07:00
Dongbo Wang 9818988e33 Update the .csproj files to point to the correct items (e.g. *.cs and *.resx) 2016-10-21 14:12:10 -07:00
Dongbo Wang 54cb65bbf2 Move *.csproj files to PowerShell/src/vs-csproj and PowerShell/test/vs-csproj to avoid confusing the latest dotnet.exe.
If a *.csproj file is in a project directory, the latest dotnet.exe will use it, instead of the project.json file, to build the project.
2016-10-21 14:12:10 -07:00
Mike Richmond 3bbeabf6bc Adding WindowsVersion to Get-ComputerInfo 2016-10-19 14:59:38 -07:00
Chunqing Chen 0908547083 Remove the unnecessary use of lock in PseudoParameterBinder to avoid deadlock (#2501)
This is the fix to MSFT:9039127 [RFC] : SMA Jobs stop processing, show various status but never change or progress; due to deadlock in sandbox process.
The fix is brought to GitHub to make sure GitHub powershell always has the latest changes.
2016-10-18 17:32:56 -07:00
Andrew Schwartzmeyer 8e3861a64b Merge pull request #2441 from andschwa/native-perror
Fix error handling of libpsl-native
2016-10-17 11:13:31 -07:00
iSazonov 7d97bebeb2 Refactor 'Get-WinEvent' to use StringBuilder for XPath query construction (#2467)
1. Move "string" to const
2. Use StringBuilder everywhere
2016-10-17 10:10:17 -07:00
Andrew Schwartzmeyer 07a1841eb6 Set libpsl-native configuration to release
This disables asserts.
2016-10-14 15:43:00 -07:00
Andrew Schwartzmeyer e630c6f79c Fix GetCurrentThreadId 2016-10-14 15:43:00 -07:00
Andrew Schwartzmeyer 24d0ce36e6 Fix SetDate
And use a bunch of unsafe code because of concerns about stack size.
2016-10-14 15:43:00 -07:00
Andrew Schwartzmeyer cdcd2c25c8 Remove Windows ERROR codes from pal.h 2016-10-14 15:43:00 -07:00
Andrew Schwartzmeyer 011d947fd5 Clean up GetFileOwner 2016-10-14 15:43:00 -07:00
Andrew Schwartzmeyer 4038cd61f2 Clean up IsExecutable 2016-10-14 15:42:59 -07:00
Andrew Schwartzmeyer 8b3e8be1bc Clean up IsDirectory 2016-10-14 15:42:59 -07:00
Andrew Schwartzmeyer 2a6b84ed1b Clean up IsHardLink 2016-10-14 15:42:59 -07:00
Andrew Schwartzmeyer e343e8ec60 Clean up GetUserFromPid 2016-10-14 15:42:59 -07:00
Andrew Schwartzmeyer 14e2389e71 Clean up GetComputerName 2016-10-14 15:42:59 -07:00
Andrew Schwartzmeyer 1d240ef3e4 Remove GetLStat 2016-10-14 15:42:59 -07:00
Andrew Schwartzmeyer b4b2278571 Clean up CreateHardLink 2016-10-14 15:42:58 -07:00
Andrew Schwartzmeyer 0ce5575f57 Clean up CreateSymLink 2016-10-14 15:42:58 -07:00
Andrew Schwartzmeyer bdfe69355f Clean up GetComputerName 2016-10-14 15:30:19 -07:00
Andrew Schwartzmeyer 82867a5c12 Clean up FollowSymLink 2016-10-14 15:30:19 -07:00
Andrew Schwartzmeyer fc5a1ae6aa Clean up SetDate
Remove pass-by-reference from C API
2016-10-14 15:30:19 -07:00
Andrew Schwartzmeyer 196a37b118 Add native errno to ErrorCategory mapper 2016-10-14 15:30:19 -07:00
Andrew Schwartzmeyer e1aeeaa9c2 Switch to Win32Exception(GetLastWin32Error)
This is verified to work "correctly" on Linux in that it gets the
`perror` for the last set value of errno in native code.

No extra mapping or handling needs to be done on our part.

Keeping the strerror_r implementation in the history for the valuable
implementation of config.h.in in the library.
2016-10-14 15:30:19 -07:00
Andrew Schwartzmeyer 6c3e536ca8 Add configure to CMake to detect GNU strerror_r
* Add getstrerror to libpsl-native
* Add Unix.GetLastPerror to CorePsPlatform
2016-10-14 15:30:19 -07:00
Andrew Schwartzmeyer b0cd7ba3dc Clean up libpsl-native headers 2016-10-14 15:30:19 -07:00
Steve Lee 001f6ecf72 Addressing static analysis issue (#2486)
* Addressing static code analysis issue from TFS:8328091

* Addressing code review feedback

* Fixed build break

* Addressing static analysis issue TFS:8328091
2016-10-14 15:12:17 -07:00
wangzq 1cc0ef6141 Save file as UTF8 with BOM (Fixes #2476) (#2477) 2016-10-14 13:13:50 -07:00
Dongbo Wang f02b6ef97a Exclude 'Registry' and 'Certificate' providers from UNIX PS since they don't work on UNIX platform.
With this change, 'Registry' and 'Certificate' providers won't be compiled for UNIX PS.
2016-10-14 10:02:44 -07:00
Dongbo Wang d0c60e049d Avoid calling static members from 'Microsoft.Win32.Registry' on UNIX, especially the code that would run in TypeInitializer.
This is because with the latest .NET Core packages (1.1.0 preview), calling static members from 'Microsoft.Win32.Registry' will raise 'PlatformNotSupportedException'.
2016-10-14 10:02:44 -07:00
Dongbo Wang 2e402cfef1 Update powershell to depend on latest dotnet core packages (preview1-24530-04 from 9/30/2016) 2016-10-14 10:02:44 -07:00
Steve Lee 9e47ad4733 Addressing static code analysis issue (#2470)
* Addressing static code analysis issue: Add CultureInfo to 'Type.InvokeMember' calls

* Addressing code review feedback

* Fixed build break
2016-10-13 14:46:21 -07:00
Francisco Gamino d717458e7d Fixing get-help <cmdletName> -online for .NET Core on Desktop. (#2174)
In PS Core on windows, we try to locate the default web browser and use it for online help. If we cannot find the default web browser (in NanoServer/IoT), we error out.
2016-10-12 12:16:32 -07:00
Mike Richmond e188c992e8 Fixing JSON property accessor to attempt user settings directory creation on the first write operation 2016-10-07 21:45:38 -07:00
iSazonov 6ef590dee3 Fix Get-WinEvent -FilterHashtable to work with named event data field (#2373)
Fix Get-WinEvent -FilterHashtable to work with named event data field

Now FilterHashtable parameter in Get-WinEvent for named data field:
1. generates a valid query, ex. @{Logname="System";Param="a"}
2. generates a valid query for multiple values, ex.
@{Logname="System";Param="a","b"}

Also removed double cast in the original code and added more tests to cover the fixed scenarios.
2016-10-07 11:48:08 -07:00
Dongbo Wang e078b0acb7 Use 'CurrentCulture' for error message and update test to clean up resources 2016-10-05 16:18:50 -07:00