Commit Graph
44 Commits
Author SHA1 Message Date
Dmitry Volodin fa64ecba70 Apply IDE0019: InlineAsTypeCheck in Microsoft.PowerShell.Commands (#19688) 2023-05-25 09:28:59 +05:00
CarloToso b85fe99f5a Use interpolated strings 2 (#18978) 2023-01-20 22:22:10 +05:00
MartinGC94 a7559e0987 Add output type attributes for Get-WinEvent (#17948) 2022-08-23 06:17:33 +00:00
xtqqczze 0f2f23f67a Enable IDE0049 PreferBuiltInOrFrameworkType (#14491) 2021-07-28 12:39:14 -07:00
xtqqczze 0991ecf2d4 Fix RCS1139: Add summary element to documentation comment (#14442)
https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1139.md
2020-12-22 08:44:30 +05:00
xtqqczze 1ab2c0c2bd Fix IDE0032: UseAutoProperty part 3 (#14443)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0032
2020-12-19 12:01:11 +05:00
xtqqczze 4ab1b90d08 Fix CA1822: Mark members as static part 2 (#14225)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1822
2020-11-24 12:05:34 +05:00
xtqqczze 7e26eca03e Fix IDE0090: Simplify new expression part 1 (#14027)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0090
2020-11-20 17:36:53 +05:00
xtqqczze 4d2965af29 Autofix SA1518: The code must not contain extra blank lines at the end of the file (#13574) 2020-11-11 12:15:20 +05:00
xtqqczze 6b009c11e3 Remove unnecessary usings part 2 (#14017)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0005
2020-11-10 08:15:04 +05:00
xtqqczze af8558b065 Enable CA1834: Consider using 'StringBuilder.Append(char)' when applicable (#13878)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1834
2020-10-30 12:07:18 +05:00
xtqqczze ac9846bf40 Fix IDE0044: MakeFieldReadonly part 2 (#13885)
https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0044
2020-10-30 11:58:48 +05:00
Dongbo Wang 4b9b0788ed Revert "Use is null syntax (#13277)" (#13322)
This reverts commit 6c03776d74.
2020-07-30 16:06:38 -07:00
xtqqczze 6c03776d74 Use is null syntax (#13277)
Replace `== null` with `is null`
2020-07-30 18:04:03 +05:00
xtqqczze 0d5d017f0f Code redundancy fixes (#12916)
* Autofix `RCS1036: Remove redundant empty line`

* Autofix `RCS1037: Remove trailing white-space`

* Autofix `RCS1033: Remove redundant boolean literal`

* Autofix: `RCS1038: Remove empty statement`

* Autofix `RCS1041: Remove empty initializer`

* Autofix `RCS1097: Remove redundant 'ToString' call

* Autofix: `RCS1420: Operator is unnecessary`
2020-06-11 11:25:35 +05:00
xtqqczze 056b9d7ca3 Formatting: remove duplicate semicolons (#12666) 2020-05-17 15:07:06 -07:00
Steve Lee b7cb335f03 Update copyright notice to latest guidance (#12190) 2020-03-24 11:08:37 -07:00
David Smatlak 3923ca1728 Fixes FWLinks for PS7 online help documents (#11071) 2019-12-02 10:25:56 -08:00
Ilya c17d5a7a27 Review currentculture (#11044)
Replace StringComparison.CurrentCulture with StringComparison.Ordinal where it is used without the need.
2019-11-22 08:37:42 +05:00
Ilya d58a82ad19 Cleanup: use the built-in type alias (#10882) 2019-11-06 08:47:32 +05:00
Ilya be54be4162 Add limit check in Get-WinEvent (#10648)
ReadEvent() returns the error if our query contains number of logs more then 256.
So add the limit check and issue user-friendly error message.
2019-10-23 22:28:59 +05:00
Ilya 2ff65c100b Move some of the creations of WildcardPattern in outer loop to avoid unnecessary allocation (#10053) 2019-07-10 09:06:34 -07:00
Ilya 74c87ab20b Cleanup: Use EndsWith(char) and StartsWith(char) (#9994) 2019-06-25 11:02:31 -07:00
Ilya bd6fdae735 Cleanup: sort usings (#9490) 2019-04-30 10:25:11 +05:00
Ilya e9ffbe5cf2 Run CodeFormatter for Diagnostics module (#9378) 2019-04-18 08:13:01 +05:00
Ilya 233b54ed65 Style: Add a space after "//" in comments and remove unneeded comments after "}" (#8576) 2019-01-05 17:51:20 -08:00
Ilya 1be3f4cc0e Style: Add the ending period to the XML document texts (#8577) 2019-01-05 15:40:24 -08:00
Ilya 42ba9d22ce Style: Change 'Object' to 'object' (#8522) 2018-12-24 12:01:44 +05:00
Steve Lee 4af3068566 Code cleanup: Add space after closing brace where needed (#8530)
* Update TestService

* Update WebListener

* Update Controllers

* Update ExpTest

* Update MyApp

* Update Logic

* Update Logic

* Update MyApp

* Update Microsoft.Management.Infrastructure.CimCmdlets

* Update Microsoft.PowerShell.Commands.Diagnostics

* Update Microsoft.PowerShell.ScheduledJob

* Update Microsoft.WSMan.Management

* Update Microsoft.WSMan.Runtime

* Update ResGen

* Update TypeCatalogGen

* Update commands

* Update Eventing

* Update Reader

* Update utility

* Update ShowCommand

* Update trace

* Update WebCmdlet

* Update Common

* Update CoreCLR

* Update common

* Update format-object

* Update format-wide

* Update out-file

* Update out-printer

* Update out-string

* Update OutGridView

* Update LocalAccounts

* Update Commands

* Update security

* Update CoreCLR

* Update DscSupport

* Update engine

* Update help

* Update logging

* Update namespaces

* Update security

* Update utils

* Update config

* Update perfCounters

* Update tracing

* Update cmdletization

* Update other

* Update cim

* Update xml

* Update CoreCLR

* Update common

* Update DefaultFormatters

* Update out-console

* Update out-textInterface

* Update DisplayDatabase

* Update Utilities

* Update COM

* Update ComInterop

* Update CommandCompletion

* Update debugger

* Update ExperimentalFeature

* Update hostifaces

* Update interpreter

* Update lang

* Update Modules

* Update parser

* Update runtime

* Update client

* Update commands

* Update common

* Update fanin

* Update server

* Update WireDataFormat

* Update Binding

* Update Operations

* Update interface

* Update cmdletization

* Update cim

* Update management

* Update WindowsTaskbarJumpList

* Update msh
2018-12-24 11:20:06 +05:00
Ilya e177fcaef6 CodeFactor code style cleanup: replace literal empty strings with 'string.Empty' (#6950) 2018-06-12 12:30:10 -07:00
Steve Lee c1c5344a88 Update copyright and license headers (#6134)
Based on standard practices, we need to have a copyright and license notice at the top of each source file. Removed existing copyrights and updated/added copyright notices for .h, .cpp, .cs, .ps1, and .psm1 files.

Updated module manifests for consistency to have Author = "PowerShell" and Company = "Microsoft Corporation". Removed multiple line breaks.

Separate PR coming to update contribution document for new source files: #6140

Manually reviewed each change.

Fix #6073
2018-02-13 09:23:53 -08:00
Steve Lee 4bc52d2358 Use consistent '(c)' for copyright symbol (#5210)
- Remove the year about copyright
- Fix casing of `All rights reserved`
- Replace Unicode characters representing single quote with a single quote
2017-10-26 14:12:19 -07:00
Ilya f8ae37c2cb Close eventLogSession and EventLogReader to unlock an etl file (#4034)
Fix #3979
2017-07-06 23:05:41 -07:00
Jason Shirk 02b5f357a2 Remove trailing whitespace (#3001) 2017-01-16 13:31:14 -08: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
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
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 58a2ba730d Merge pull request #2046 from xiaoyinl/use-https-links
Use HTTPS links for go.microsoft.com
2016-09-01 17:23:09 -07:00
Josh Soref eb3fd7ae6c Spelling comments (#2066)
* spelling: comments in src/Microsoft.Management.Infrastructure.CimCmdlets

* spelling: comments in src/Microsoft.PackageManagement.ArchiverProviders

* spelling: comments in src/Microsoft.PackageManagement.CoreProviders

* spelling: comments in src/Microsoft.PackageManagement.MetaProvider.PowerShell

* spelling: comments in src/Microsoft.PackageManagement.MsiProvider

* spelling: comments in src/Microsoft.PackageManagement.MsuProvider

* spelling: comments in src/Microsoft.PackageManagement.NuGetProvider

* spelling: comments in src/Microsoft.PackageManagement.PackageSourceListProvider

* spelling: comments in src/Microsoft.PackageManagement

* spelling: comments in src/Microsoft.PowerShell.Activities

* spelling: comments in src/Microsoft.PowerShell.Commands.Diagnostics

* spelling: comments in src/Microsoft.PowerShell.Commands.Management

* spelling: comments in src/Microsoft.PowerShell.Commands.Utility

* spelling: comments in src/Microsoft.PowerShell.ConsoleHost

* spelling: comments in src/Microsoft.PowerShell.Core.Activities

* spelling: comments in src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext

* spelling: comments in src/Microsoft.PowerShell.CoreCLR.Eventing

* spelling: comments in src/Microsoft.PowerShell.Diagnostics.Activities

* spelling: comments in src/Microsoft.PowerShell.GraphicalHost

* spelling: comments in src/Microsoft.PowerShell.LocalAccounts

* spelling: comments in src/Microsoft.PowerShell.Management.Activities

* spelling: comments in src/Microsoft.PowerShell.PSReadLine

* spelling: comments in src/Microsoft.PowerShell.PackageManagement

* spelling: comments in src/Microsoft.PowerShell.ScheduledJob

* spelling: comments in src/Microsoft.PowerShell.Security.Activities

* spelling: comments in src/Microsoft.PowerShell.Security

* spelling: comments in src/Microsoft.PowerShell.Utility.Activities

* spelling: comments in src/Microsoft.PowerShell.Workflow.ServiceCore

* spelling: comments in src/Microsoft.WSMan.Management.Activities

* spelling: comments in src/Modules

* spelling: comments in src/Schemas

* spelling: comments in src/libpsl-native

* spelling: comments in src/powershell-native

* spelling: comments in build.psm1

* spelling: comments in src/System.Management.Automation/CoreCLR

* spelling: comments in src/System.Management.Automation/DscSupport

* spelling: comments in src/System.Management.Automation/cimSupport

* spelling: comments in src/System.Management.Automation/commands

* spelling: comments in src/System.Management.Automation/engine/Modules
2016-08-26 13:46:03 -07:00
xiaoyinl f538eeb416 Use HTTPS links for go.microsoft.com
I replace all occurrences of http://go.microsoft.com with https://go.microsoft.com in text files.
2016-08-23 21:21:31 -04: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
Andrew Schwartzmeyer 0f04de1e96 Fix some documentation warnings
Mostly low-hanging fruit and Linux additions/changes.
2016-07-18 19:08:28 -07:00
Sergei Vorobev b755212f5d Fix GetEventResources problem in Microsoft.PowerShell.Commands.Diagnostics
-Move logic about instantiating ResourceManager in one place
-Add CommonUtils.cs to CoreCLR build
-Update resources generation with dotnet cli naming pattern
2016-07-01 12:20:48 -07:00
PowerShell Team 4e4a07c5e8 Copy files for Microsoft.PowerShell.Commands.Diagnostics [SD:714215]
Commit 2e2daeaff52930d981a31e0030d7161c4b45cc48
2016-06-15 15:27:06 -07:00