Commit Graph
472 Commits
Author SHA1 Message Date
Aditya Patwardhan ddf40db675 Bump to .NET 8 Preview 7 (#20092) 2023-08-09 10:47:09 -07:00
Steve Lee 28548d39ac Fix use of ThrowIf where the arguments were reversed (#20052) 2023-07-31 15:03:16 -07:00
MartinGC94 3f128d680f Change how relative paths in Resolve-Path are handled when using the RelativeBasePath parameter (#19755) 2023-07-24 09:47:24 -07:00
dwtaber 3b9e70cfc8 Wait-Process: add -Any and -PassThru parameters (#19423) 2023-07-24 09:46:16 -07:00
Steve Lee 5a6c66be13 Restore-Computer and Stop-Computer should fail with error when not running via sudo on Unix (#19824) 2023-07-17 14:20:06 -07:00
Aditya Patwardhan ebe0b54340 Update to .NET 8 Preview 4 (#19696) 2023-06-21 15:17:22 -07:00
CarloToso cb2848c19b Code cleanup for Get-Content to make -Head and -Tail disallow negative values (#19715) 2023-06-21 09:35:18 -07:00
Armaan Mcleod 2403e78b1e Rename file from PingPathCommand.cs to TestPathCommand.cs (#19782) 2023-06-19 10:46:08 -07:00
Berkan Diler 0f53e80335 Make use of the new Random.Shared property (#18417) 2023-06-12 17:31:04 -07:00
Sean Wheeler b09ee1689b Add ParameterSetName for the -Detailed parameter (#19727) 2023-06-05 17:19:49 -07:00
CarloToso 0b42d92d4d six files (#19695) 2023-05-25 10:12:42 -07:00
Dmitry Volodin fa64ecba70 Apply IDE0019: InlineAsTypeCheck in Microsoft.PowerShell.Commands (#19688) 2023-05-25 09:28:59 +05:00
Dominik Kaszewski ea68edc686 Set-Clipboard -AsOSC52 (#18222)
* Set remote clipboard using OSC52

* Fix codefactor comment

* Rename parameter from Using to As

* Rename alias
2023-05-01 14:53:31 -07:00
Jack CaseyandTravis Plunk 698742ea9f Test-Connection: Increase output detail when performing a tcp test (#11452)
* Added verbose TCP test logic

* Cleaned up output, removed source IP address

* Consolidated detailed output logic into ProcessConnectionByTCPPort()

* Updated existing tests with -Quiet switch

* Improved output formatting, changed logic to match

* Error handling and logic improvements

* Updated tests to match new output

* Updated logic, tcp tests now run once by default

* Moved TcpConnectionTestResult enum into TcpTestStatus class

* Removed unnecessary whitespace

* Wrapped TcpClient() in Using statement

* Appended missing period on comments

* Change TcpTestStatus to TcpPortStatus for better clarity

* Set default count back to 4

* Move stopwatch reset into finally block

* Change TcpConnectionTestResult.New to TcpConnectionTestResult.None

* Formatting fixes

* Increase column size for Result output

* Update logic for -quiet option

* Change "TestNum" property to "Id"

* Change Destination and DestinationAddress to Target and TargetAddress in TcpPortStatus

* Implement new form of using declaration

* Fix indentation

* Update output, improve logic and update tests

* Add CancellationToken to allow cancel before timeout

* Assign testResult.Connected to client.Connected

* Move TcpPortStatus object creation to after connection test

* Remove delay from final connection test in loop

* Move Count logic from ProcessConnectionByTCPPort into own function

* Fix small formatting error

* Add handling for TaskCanceledException

* Remove redundant CancellationToken getter

* Clean up handling of SocketException

* Increase readability of final loop check

* Remove unnecessary TimeSpan invocation

* Rename cancellationTokenSource to match convention

* Move SetCountForTcpTest() into BeginProcessing()

* Added nameof to Count check

* Removed explicit type declaration for TcpClient

* Move delay and timeout evaluation out of the cycle

* Remove redundant CancellationTokenSource

* Initialize detailed SwitchParameter

* Add check for Detailed parameter

* Remove redundant tests for non-detailed output

* Add return after first boolean output

* Update tests with new detailed parameter set

---------

Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
2023-05-01 14:16:11 -07:00
PowerShell Team Bot e1b392b6ff Update .NET SDK version from 8.0.100-preview.2.23157.25 to 8.0.100-preview.3.23178.7 (#19381) 2023-04-18 15:24:51 -07:00
Steve Lee 2553a56db2 Add -Environment parameter to Start-Process (#19374)
* Add `-Environment` parameter to `Start-Process`

* address codefactor

* fix test for Windows

* handle case where value is $null to remove env var

* change variables to make it more clear what the test is doing
2023-03-27 11:05:04 -07:00
MartinGC94 48c9d68356 Add the parameter -RelativeBasePath to Resolve-Path (#19358) 2023-03-22 16:44:48 -07:00
MartinGC94 8b964ded36 Speed up Resolve-Path relative path resolution (#19171) 2023-03-15 08:12:09 +05:00
Aditya Patwardhan b58db8b8f7 Bump .NET to Preview 2 version (#19305) 2023-03-09 15:06:36 -08:00
Jordan Borean efc7385c50 Fix Start-Process -Wait with -Credential (#19096)
Allows a non-administrator user to be able to -Wait on a Start-Process
call with a custom credential specified.
2023-03-06 10:31:16 -08:00
CarloToso d00407612c Fix codefactor if part 1 (#19266) 2023-03-03 23:51:53 +05:00
xtqqczze fe8cc5dfe1 Use ArgumentException.ThrowIfNullOrEmpty as appropriate [part 1] (#19215) 2023-02-27 17:02:51 -08:00
Aditya Patwardhan 2d15e0c5b6 Update to .NET 8 preview 1 build (#19194) 2023-02-22 16:12:16 -08:00
Armaan Mcleod 1ee8df5fe1 Added minor readability and refactoring fixes to Process.cs (#19123) 2023-02-09 15:08:10 +05:00
spaette ec0eb22062 Fix typos in comments (#19064) 2023-02-03 10:40:43 +05:00
Steve LeeandIlya 7fe5cb3e35 Fix Start-Process -Credential -Wait to work on Windows (#19082)
* address Ilya's feedback, simplify to just WaitForExit() when cred is used

* Update src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs

Co-authored-by: Ilya <darpa@yandex.ru>

---------

Co-authored-by: Ilya <darpa@yandex.ru>
2023-02-02 16:15:53 -08:00
spaette d29f34b5c2 typos (#19058) 2023-01-30 09:48:00 -08:00
CarloToso b85fe99f5a Use interpolated strings 2 (#18978) 2023-01-20 22:22:10 +05:00
James Truher [MSFT] 4f57804f46 Fix up all comments to be in the proper order with proper spacing (#18619) 2023-01-03 12:12:42 -08:00
CarloToso b48943ce31 Replace ArgumentNullException(nameof()) -> ArgumentNullException.ThrowIfNull() 2 (#18792) 2022-12-16 16:46:45 +05:00
CarloToso 2ddc63f151 Replace ArgumentNullException(nameof()) -> ArgumentNullException.ThrowIfNull() (#18784) 2022-12-14 18:30:33 +05:00
Ilya 5d9835f46e Use File.OpenHandle() instead CreateFileW pinvoke (#18722) 2022-12-05 22:38:45 +05:00
Ilya 6aa74c5c3c Remove ArchitectureSensitiveAttribute from the code base (#18598) 2022-11-18 14:15:05 -08:00
Steve Lee 0ea9c324d0 Convert DllImport to LibraryImport for recyclebin, clipboard, and computerinfo cmdlets (#18526) 2022-11-14 12:46:59 -05:00
Steve Lee c740a07e10 Change public API mention of monad to PowerShell (#18491)
* Change public API mention of `monad` to PowerShell

* looks like I forgot to save changes in some files
2022-11-14 12:45:23 -05:00
Travis Plunk 665bf21fcb Bump to use internal .NET 7 GA build (#18508) 2022-11-09 22:51:24 +00:00
Steve Lee 837482376e Replace msh in public API comment based documentation with PowerShell equivalent (#18483) 2022-11-08 08:27:52 +05:00
xtqqczze dd884459c1 Use generic GetValues<T>, GetNames<T> enum methods (#18391) 2022-10-27 09:42:33 -07:00
Nicklas Bjälemark a06d908587 Fix incorrect cmdlet name in the script used by Restart-Computer (#18374) 2022-10-26 09:27:36 -07:00
Aditya Patwardhan 028eeb0457 Bump to .NET 7 to version 7.0.100-rc.2.22477.20 (#18286) 2022-10-18 16:49:18 -07:00
Ilya 8973b0c121 Use overload APIs that take char instead of string when it's possible (#18179) 2022-09-29 09:39:04 -07:00
Aditya Patwardhan 29ddf44892 Update DotnetRuntimeMetadata.json for .NET 7 RC1 build (#18091) 2022-09-15 14:12:52 -07:00
creative-cloud 2ec7aea2ec Fixing CA2014 warnings and removing the warning suppressions (#17982) 2022-09-13 09:46:52 -07:00
github-actions[bot] b66a93f74e Update .NET SDK version from 7.0.100-preview.6.22352.1 to 7.0.100-preview.7.22377.5 (#17776) 2022-08-02 22:23:59 -07:00
Steve Lee 9213b77659 Allow commands to still be executed even if the current working directory no longer exists (#17579) 2022-08-01 21:43:54 -07:00
Frode Flaten 2d4a6bf475 Use null propagation operator in Management and ConsoleHost (#17791) 2022-08-01 09:20:44 -07:00
Frode Flaten 5f4e100456 Use null propagation operator for windows build (#17795)
* Use null propagation in CimCmdlets

* Use null propagation in Diagnostics and Management

* ignore IDE0031 rule in ConsoleHost

* Use null propagation in WSMan.Management

* Use null propagation in SMA

* ignore IDE0031 for securityDescHandle

* cleanup after review
2022-07-29 10:34:09 -07:00
Matt Graeber 6bf8a98aed Adding Virtualization-Based Security feature names to Get-ComputerInfo (#16415) 2022-07-26 10:12:36 +05:00
Dmitry Volodin 7ce0df7187 Use compound assignment in /Microsoft.PowerShell.Commands (#17722) 2022-07-25 17:04:56 -07:00
github-actions[bot] 17b23e3ebc Update .NET SDK version from 7.0.100-preview.5.22307.18 to 7.0.100-preview.6.22352.1 (#17634) 2022-07-06 17:35:59 -07:00