diff --git a/Engine/Commands/GetScriptAnalyzerRuleCommand.cs b/Engine/Commands/GetScriptAnalyzerRuleCommand.cs index b749bc6e9..ed4799c40 100644 --- a/Engine/Commands/GetScriptAnalyzerRuleCommand.cs +++ b/Engine/Commands/GetScriptAnalyzerRuleCommand.cs @@ -10,16 +10,15 @@ // THE SOFTWARE. // -using Microsoft.PowerShell.Commands; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Management.Automation; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Commands +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands { /// /// GetScriptAnalyzerRuleCommand: Cmdlet to list all the analyzer rule names and descriptions. diff --git a/Engine/Commands/InvokeScriptAnalyzerCommand.cs b/Engine/Commands/InvokeScriptAnalyzerCommand.cs index 16c2911ff..02ef89a75 100644 --- a/Engine/Commands/InvokeScriptAnalyzerCommand.cs +++ b/Engine/Commands/InvokeScriptAnalyzerCommand.cs @@ -11,22 +11,17 @@ // using System.Text.RegularExpressions; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; using System; using System.Collections.Generic; -using System.ComponentModel.Composition; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; using System.Management.Automation; using System.Management.Automation.Language; -using System.Resources; -using System.Threading; -using System.Reflection; using System.IO; -using System.Text; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Commands +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands { /// /// InvokeScriptAnalyzerCommand: Cmdlet to statically check PowerShell scripts. diff --git a/Engine/Generic/AvoidCmdletGeneric.cs b/Engine/Generic/AvoidCmdletGeneric.cs index 1ae87fa31..5546295bf 100644 --- a/Engine/Generic/AvoidCmdletGeneric.cs +++ b/Engine/Generic/AvoidCmdletGeneric.cs @@ -13,11 +13,9 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Management.Automation.Language; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// Represents an abstract class for rule that checks whether the script @@ -38,7 +36,7 @@ public IEnumerable AnalyzeScript(Ast ast, string fileName) // Finds all CommandAsts. IEnumerable commandAsts = ast.FindAll(testAst => testAst is CommandAst, true); - List cmdletNameAndAliases = Microsoft.Windows.Powershell.ScriptAnalyzer.Helper.Instance.CmdletNameAndAliases(GetCmdletName()); + List cmdletNameAndAliases = Microsoft.Windows.PowerShell.ScriptAnalyzer.Helper.Instance.CmdletNameAndAliases(GetCmdletName()); // Iterrates all CommandAsts and check the command name. foreach (CommandAst cmdAst in commandAsts) diff --git a/Engine/Generic/AvoidParameterGeneric.cs b/Engine/Generic/AvoidParameterGeneric.cs index 2c140e39c..b61835056 100644 --- a/Engine/Generic/AvoidParameterGeneric.cs +++ b/Engine/Generic/AvoidParameterGeneric.cs @@ -12,12 +12,9 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Management.Automation.Language; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// Represents an abstract class for rule that checks that diff --git a/Engine/Generic/DiagnosticRecord.cs b/Engine/Generic/DiagnosticRecord.cs index bc2ada6dd..d62a5217c 100644 --- a/Engine/Generic/DiagnosticRecord.cs +++ b/Engine/Generic/DiagnosticRecord.cs @@ -10,14 +10,9 @@ // THE SOFTWARE. // -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Management.Automation.Language; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// Represents a result from a PSScriptAnalyzer rule. diff --git a/Engine/Generic/ExternalRule.cs b/Engine/Generic/ExternalRule.cs index c73792e28..b637ce166 100644 --- a/Engine/Generic/ExternalRule.cs +++ b/Engine/Generic/ExternalRule.cs @@ -10,13 +10,8 @@ // THE SOFTWARE. // -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { internal class ExternalRule : IExternalRule { diff --git a/Engine/Generic/IDSCResourceRule.cs b/Engine/Generic/IDSCResourceRule.cs index 935179b3a..cbb645fb2 100644 --- a/Engine/Generic/IDSCResourceRule.cs +++ b/Engine/Generic/IDSCResourceRule.cs @@ -13,7 +13,7 @@ using System.Collections.Generic; using System.Management.Automation.Language; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// Represents an interface for a DSC rule that analyzes a DSC resource diff --git a/Engine/Generic/IExternalRule.cs b/Engine/Generic/IExternalRule.cs index d51f33bea..935f7fdde 100644 --- a/Engine/Generic/IExternalRule.cs +++ b/Engine/Generic/IExternalRule.cs @@ -10,13 +10,8 @@ // THE SOFTWARE. // -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// Represents an interface for an external analyzer rule. diff --git a/Engine/Generic/ILogger.cs b/Engine/Generic/ILogger.cs index 5d51378a3..9f0adac0a 100644 --- a/Engine/Generic/ILogger.cs +++ b/Engine/Generic/ILogger.cs @@ -11,13 +11,9 @@ // using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Commands; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// ILogger: An interface for a PSScriptAnalyzer logger to output the results of PSScriptAnalyzer rules. diff --git a/Engine/Generic/IRule.cs b/Engine/Generic/IRule.cs index e9ddbbf8e..4ba707d7d 100644 --- a/Engine/Generic/IRule.cs +++ b/Engine/Generic/IRule.cs @@ -10,7 +10,7 @@ // THE SOFTWARE. // -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// An interface for an analyzer rule that analyzes the Ast. diff --git a/Engine/Generic/IScriptRule.cs b/Engine/Generic/IScriptRule.cs index c9993d266..15bafbe87 100644 --- a/Engine/Generic/IScriptRule.cs +++ b/Engine/Generic/IScriptRule.cs @@ -17,7 +17,7 @@ using System.Threading.Tasks; using System.Management.Automation.Language; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// Represents an interface for an analyzer rule that analyzes the Ast. diff --git a/Engine/Generic/ITokenRule.cs b/Engine/Generic/ITokenRule.cs index 2213f8d57..e4450d9aa 100644 --- a/Engine/Generic/ITokenRule.cs +++ b/Engine/Generic/ITokenRule.cs @@ -13,7 +13,7 @@ using System.Collections.Generic; using System.Management.Automation.Language; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// Represents an interface for an analyzer rule that analyzes the tokens of a script. diff --git a/Engine/Generic/LoggerInfo.cs b/Engine/Generic/LoggerInfo.cs index ebb9d72e9..c5d32bce8 100644 --- a/Engine/Generic/LoggerInfo.cs +++ b/Engine/Generic/LoggerInfo.cs @@ -10,14 +10,9 @@ // THE SOFTWARE. // -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Diagnostics.CodeAnalysis; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// Represents an internal class to properly display the name and description of a logger. diff --git a/Engine/Generic/RuleInfo.cs b/Engine/Generic/RuleInfo.cs index 666c84afa..8c90d5e6a 100644 --- a/Engine/Generic/RuleInfo.cs +++ b/Engine/Generic/RuleInfo.cs @@ -10,14 +10,9 @@ // THE SOFTWARE. // -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Diagnostics.CodeAnalysis; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// Represents an internal class to properly display the name and description of a rule. diff --git a/Engine/Generic/RuleSeverity.cs b/Engine/Generic/RuleSeverity.cs index 75496ed43..d975aa239 100644 --- a/Engine/Generic/RuleSeverity.cs +++ b/Engine/Generic/RuleSeverity.cs @@ -10,7 +10,7 @@ // THE SOFTWARE. // -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// Represents the severity of a PSScriptAnalyzer rule diff --git a/Engine/Generic/RuleSuppression.cs b/Engine/Generic/RuleSuppression.cs index 93319a254..a90f1b88c 100644 --- a/Engine/Generic/RuleSuppression.cs +++ b/Engine/Generic/RuleSuppression.cs @@ -17,7 +17,7 @@ using System.Text.RegularExpressions; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// diff --git a/Engine/Generic/SkipNamedBlock.cs b/Engine/Generic/SkipNamedBlock.cs index 448c668f5..6de4dd094 100644 --- a/Engine/Generic/SkipNamedBlock.cs +++ b/Engine/Generic/SkipNamedBlock.cs @@ -13,11 +13,9 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Management.Automation.Language; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// This class extends AstVisitor2 and will skip any namedblockast and commandast diff --git a/Engine/Generic/SkipTypeDefinition.cs b/Engine/Generic/SkipTypeDefinition.cs index c95d772fe..4f6ad239d 100644 --- a/Engine/Generic/SkipTypeDefinition.cs +++ b/Engine/Generic/SkipTypeDefinition.cs @@ -13,7 +13,7 @@ using System.Collections.Generic; using System.Management.Automation.Language; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// This class extends AstVisitor and will skip any typedefinitionast diff --git a/Engine/Generic/SourceType.cs b/Engine/Generic/SourceType.cs index bab7cd0e3..dfff87f2a 100644 --- a/Engine/Generic/SourceType.cs +++ b/Engine/Generic/SourceType.cs @@ -10,13 +10,7 @@ // THE SOFTWARE. // -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// Represents a source name of a script analyzer rule. diff --git a/Engine/Generic/SuppressedRecord.cs b/Engine/Generic/SuppressedRecord.cs index 11fbefcfd..8a096087e 100644 --- a/Engine/Generic/SuppressedRecord.cs +++ b/Engine/Generic/SuppressedRecord.cs @@ -1,10 +1,16 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +// +// Copyright (c) Microsoft Corporation. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Generic +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic { /// /// Represents a suppressed diagnostic record diff --git a/Engine/Helper.cs b/Engine/Helper.cs index 2f334241d..94bc8b871 100644 --- a/Engine/Helper.cs +++ b/Engine/Helper.cs @@ -16,11 +16,10 @@ using System.Linq; using System.Management.Automation; using System.Management.Automation.Language; -using System.Management.Automation.Runspaces; using System.Globalization; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer { /// diff --git a/Engine/Loggers/WriteObjectsLogger.cs b/Engine/Loggers/WriteObjectsLogger.cs index 3b7829f3f..1ca5d7703 100644 --- a/Engine/Loggers/WriteObjectsLogger.cs +++ b/Engine/Loggers/WriteObjectsLogger.cs @@ -11,19 +11,15 @@ // using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Commands; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands; using System.ComponentModel.Composition; using System.Globalization; using System.Reflection; using System.Resources; using System.Threading; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.Loggers +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Loggers { /// /// WriteObjectsLogger: Logs Diagnostics though WriteObject. @@ -34,7 +30,7 @@ public class WriteObjectsLogger : ILogger #region Private members private CultureInfo cul = Thread.CurrentThread.CurrentCulture; - private ResourceManager rm = new ResourceManager("Microsoft.Windows.Powershell.ScriptAnalyzer.Strings", + private ResourceManager rm = new ResourceManager("Microsoft.Windows.PowerShell.ScriptAnalyzer.Strings", Assembly.GetExecutingAssembly()); #endregion diff --git a/Engine/PSScriptAnalyzer.psd1 b/Engine/PSScriptAnalyzer.psd1 index bfa38cf53..2057d6ca3 100644 --- a/Engine/PSScriptAnalyzer.psd1 +++ b/Engine/PSScriptAnalyzer.psd1 @@ -8,7 +8,7 @@ Author = 'Microsoft Corporation' # Script module or binary module file associated with this manifest. -RootModule = 'Microsoft.Windows.Powershell.ScriptAnalyzer.dll' +RootModule = 'Microsoft.Windows.PowerShell.ScriptAnalyzer.dll' # Version number of this module. ModuleVersion = '1.0.1' diff --git a/Engine/ScriptAnalyzer.cs b/Engine/ScriptAnalyzer.cs index 715575a6e..24c2d0152 100644 --- a/Engine/ScriptAnalyzer.cs +++ b/Engine/ScriptAnalyzer.cs @@ -11,8 +11,8 @@ // using System.Text.RegularExpressions; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Commands; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System; using System.Collections.Generic; using System.ComponentModel.Composition; @@ -23,11 +23,9 @@ using System.Management.Automation.Language; using System.Management.Automation.Runspaces; using System.Reflection; -using System.Resources; using System.Globalization; -using System.Threading; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer { internal class ScriptAnalyzer { diff --git a/Engine/ScriptAnalyzer.format.ps1xml b/Engine/ScriptAnalyzer.format.ps1xml index 9839d5eac..be7ef3ab0 100644 --- a/Engine/ScriptAnalyzer.format.ps1xml +++ b/Engine/ScriptAnalyzer.format.ps1xml @@ -4,7 +4,7 @@ PSScriptAnalyzerView - Microsoft.Windows.Powershell.ScriptAnalyzer.Generic.DiagnosticRecord + Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord @@ -57,7 +57,7 @@ PSScriptAnalyzerView - Microsoft.Windows.Powershell.ScriptAnalyzer.Generic.SuppressedRecord + Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.SuppressedRecord @@ -110,7 +110,7 @@ ScriptAnalyzerRules - Microsoft.Windows.Powershell.ScriptAnalyzer.Generic.RuleInfo + Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.RuleInfo diff --git a/Engine/ScriptAnalyzer.types.ps1xml b/Engine/ScriptAnalyzer.types.ps1xml index ea37859ab..da989657e 100644 --- a/Engine/ScriptAnalyzer.types.ps1xml +++ b/Engine/ScriptAnalyzer.types.ps1xml @@ -1,7 +1,7 @@  - Microsoft.Windows.Powershell.ScriptAnalyzer.Generic.DiagnosticRecord + Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord Line @@ -33,7 +33,7 @@ - Microsoft.Windows.Powershell.ScriptAnalyzer.Generic.SuppressedRecord + Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.SuppressedRecord Line @@ -71,7 +71,7 @@ - Microsoft.Windows.Powershell.ScriptAnalyzer.Generic.RuleInfo + Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.RuleInfo PSStandardMembers diff --git a/Engine/ScriptAnalyzerEngine.csproj b/Engine/ScriptAnalyzerEngine.csproj index c259d0ea9..06f02c73e 100644 --- a/Engine/ScriptAnalyzerEngine.csproj +++ b/Engine/ScriptAnalyzerEngine.csproj @@ -6,7 +6,7 @@ {F4BDE3D0-3EEF-4157-8A3E-722DF7ADEF60} Library false - Microsoft.Windows.Powershell.ScriptAnalyzer + Microsoft.Windows.PowerShell.ScriptAnalyzer v4.5 512 @@ -31,7 +31,7 @@ false - Microsoft.Windows.Powershell.ScriptAnalyzer + Microsoft.Windows.PowerShell.ScriptAnalyzer diff --git a/Engine/SpecialVars.cs b/Engine/SpecialVars.cs index f616234cc..6c41f57fb 100644 --- a/Engine/SpecialVars.cs +++ b/Engine/SpecialVars.cs @@ -11,16 +11,11 @@ // using System; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Concurrent; using System.Linq; -using System.Reflection; -using System.Management.Automation.Language; using System.Management.Automation; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer { internal class SpecialVars { diff --git a/Engine/Strings.Designer.cs b/Engine/Strings.Designer.cs index 41b4079d7..74cebd11d 100644 --- a/Engine/Strings.Designer.cs +++ b/Engine/Strings.Designer.cs @@ -1,16 +1,14 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.35317 // -// Copyright (c) Microsoft Corporation. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ -namespace Microsoft.Windows.Powershell.ScriptAnalyzer { +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer { using System; @@ -41,7 +39,7 @@ internal Strings() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Windows.Powershell.ScriptAnalyzer.Strings", typeof(Strings).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Windows.PowerShell.ScriptAnalyzer.Strings", typeof(Strings).Assembly); resourceMan = temp; } return resourceMan; diff --git a/Engine/VariableAnalysis.cs b/Engine/VariableAnalysis.cs index 7c29c170f..314457ec3 100644 --- a/Engine/VariableAnalysis.cs +++ b/Engine/VariableAnalysis.cs @@ -11,18 +11,12 @@ // using System; -using System.Collections; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Concurrent; using System.Linq; -using System.Reflection; using System.Management.Automation.Language; -using System.Management.Automation; using System.Globalization; -using System.Text.RegularExpressions; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer { /// /// This class is used to analyze variable based on data flow diff --git a/Engine/VariableAnalysisBase.cs b/Engine/VariableAnalysisBase.cs index 17e7cc6c8..272699471 100644 --- a/Engine/VariableAnalysisBase.cs +++ b/Engine/VariableAnalysisBase.cs @@ -14,14 +14,13 @@ using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Collections.Concurrent; using System.Linq; using System.Reflection; using System.Management.Automation.Language; using System.Management.Automation; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer { /// /// Base class for variable details diff --git a/Rules/AvoidAlias.cs b/Rules/AvoidAlias.cs index dba65dfd0..5e9626923 100644 --- a/Rules/AvoidAlias.cs +++ b/Rules/AvoidAlias.cs @@ -13,11 +13,11 @@ using System; using System.Collections.Generic; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidAlias: Check if cmdlet alias is used. @@ -45,7 +45,7 @@ public IEnumerable AnalyzeScript(Ast ast, string fileName) // MSDN: CommandAst.GetCommandName Method if (aliasName == null) continue; - string cmdletName = Microsoft.Windows.Powershell.ScriptAnalyzer.Helper.Instance.GetCmdletNameFromAlias(aliasName); + string cmdletName = Microsoft.Windows.PowerShell.ScriptAnalyzer.Helper.Instance.GetCmdletNameFromAlias(aliasName); if (!String.IsNullOrEmpty(cmdletName)) { diff --git a/Rules/AvoidDefaultTrueValueSwitchParameter.cs b/Rules/AvoidDefaultTrueValueSwitchParameter.cs index 2572a1fb9..a2f892571 100644 --- a/Rules/AvoidDefaultTrueValueSwitchParameter.cs +++ b/Rules/AvoidDefaultTrueValueSwitchParameter.cs @@ -14,11 +14,11 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidDefaultTrueValueSwitchParameter: Check that switch parameter does not default to true. diff --git a/Rules/AvoidEmptyCatchBlock.cs b/Rules/AvoidEmptyCatchBlock.cs index 1c9c57b76..6ee312d76 100644 --- a/Rules/AvoidEmptyCatchBlock.cs +++ b/Rules/AvoidEmptyCatchBlock.cs @@ -13,11 +13,11 @@ using System; using System.Collections.Generic; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidEmptyCatchBlock: Check if any empty catch block is used. diff --git a/Rules/AvoidGlobalVars.cs b/Rules/AvoidGlobalVars.cs index 109da5ee5..4850ff5d6 100644 --- a/Rules/AvoidGlobalVars.cs +++ b/Rules/AvoidGlobalVars.cs @@ -13,11 +13,11 @@ using System; using System.Collections.Generic; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidGlobalVars: Analyzes the ast to check that global variables are not used. diff --git a/Rules/AvoidInvokingEmptyMembers.cs b/Rules/AvoidInvokingEmptyMembers.cs index 562f335fd..df30c3451 100644 --- a/Rules/AvoidInvokingEmptyMembers.cs +++ b/Rules/AvoidInvokingEmptyMembers.cs @@ -14,11 +14,11 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidAlias: Check if cmdlet alias is used. diff --git a/Rules/AvoidPositionalParameters.cs b/Rules/AvoidPositionalParameters.cs index 3a644275f..248dc4f71 100644 --- a/Rules/AvoidPositionalParameters.cs +++ b/Rules/AvoidPositionalParameters.cs @@ -13,11 +13,11 @@ using System; using System.Collections.Generic; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidPositionalParameters: Check to make sure that positional parameters are not used. diff --git a/Rules/AvoidReservedCharInCmdlet.cs b/Rules/AvoidReservedCharInCmdlet.cs index 9f4637a3a..2dddfbe3c 100644 --- a/Rules/AvoidReservedCharInCmdlet.cs +++ b/Rules/AvoidReservedCharInCmdlet.cs @@ -13,13 +13,12 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Management.Automation; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// diff --git a/Rules/AvoidReservedParams.cs b/Rules/AvoidReservedParams.cs index b0211f4f9..da1077a78 100644 --- a/Rules/AvoidReservedParams.cs +++ b/Rules/AvoidReservedParams.cs @@ -14,13 +14,13 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; using System.Management.Automation; using System.Management.Automation.Internal; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidReservedParams: Analyzes the ast to check for reserved parameters in function definitions. diff --git a/Rules/AvoidShouldContinueWithoutForce.cs b/Rules/AvoidShouldContinueWithoutForce.cs index ca91b62b0..0222200e9 100644 --- a/Rules/AvoidShouldContinueWithoutForce.cs +++ b/Rules/AvoidShouldContinueWithoutForce.cs @@ -13,11 +13,11 @@ using System; using System.Collections.Generic; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidShouldContinueWithoutForceParameter: Check that if ShouldContinue is used, diff --git a/Rules/AvoidTrapStatement.cs b/Rules/AvoidTrapStatement.cs deleted file mode 100644 index 0dc9b43b1..000000000 --- a/Rules/AvoidTrapStatement.cs +++ /dev/null @@ -1,101 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -using System; -using System.Collections.Generic; -using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; -using System.ComponentModel.Composition; -using System.Globalization; - -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules -{ - /// - /// AvoidTrapStatement: Analyzes the ast to check that no traps are used. - /// - [Export(typeof(IScriptRule))] - public class AvoidTrapStatement : IScriptRule - { - /// - /// AnalyzeScript: Analyzes the ast to check that no traps are used. - /// - /// The script's ast - /// The script's file name - /// A List of diagnostic results of this rule - public IEnumerable AnalyzeScript(Ast ast, string fileName) - { - if (ast == null) throw new ArgumentNullException(Strings.NullAstErrorMessage); - - IEnumerable trapAsts = ast.FindAll(testAst => testAst is TrapStatementAst, true); - - if (trapAsts != null) - { - foreach (Ast trapAst in trapAsts) - { - yield return new DiagnosticRecord(string.Format(CultureInfo.CurrentCulture, Strings.AvoidTrapStatementError), trapAst.Extent, GetName(), DiagnosticSeverity.Warning, fileName); - } - } - } - - /// - /// GetName: Retrieves the name of this rule. - /// - /// The name of this rule - public string GetName() - { - return string.Format(CultureInfo.CurrentCulture, Strings.NameSpaceFormat, GetSourceName(), Strings.AvoidTrapStatementName); - } - - /// - /// GetCommonName: Retrieves the common name of this rule. - /// - /// The common name of this rule - public string GetCommonName() - { - return string.Format(CultureInfo.CurrentCulture, Strings.AvoidTrapStatementCommonName); - } - - /// - /// GetDescription: Retrieves the description of this rule. - /// - /// The description of this rule - public string GetDescription() - { - return string.Format(CultureInfo.CurrentCulture, Strings.AvoidTrapStatementDescription); - } - - /// - /// GetSourceType: Retrieves the type of the rule: builtin, managed or module. - /// - public SourceType GetSourceType() - { - return SourceType.Builtin; - } - - /// - /// GetSeverity: Retrieves the severity of the rule: error, warning of information. - /// - /// - public RuleSeverity GetSeverity() - { - return RuleSeverity.Warning; - } - - /// - /// GetSourceName: Retrieves the module/assembly name the rule is from. - /// - public string GetSourceName() - { - return string.Format(CultureInfo.CurrentCulture, Strings.SourceName); - } - } -} diff --git a/Rules/AvoidUninitializedVariable.cs b/Rules/AvoidUninitializedVariable.cs index 2872f0e56..6c13950ca 100644 --- a/Rules/AvoidUninitializedVariable.cs +++ b/Rules/AvoidUninitializedVariable.cs @@ -14,11 +14,11 @@ using System.Linq; using System.Collections.Generic; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidUnitializedVariable: Check if any uninitialized variable is used. diff --git a/Rules/AvoidUserNameAndPasswordParams.cs b/Rules/AvoidUserNameAndPasswordParams.cs index a593b1ae7..823ca6e3c 100644 --- a/Rules/AvoidUserNameAndPasswordParams.cs +++ b/Rules/AvoidUserNameAndPasswordParams.cs @@ -14,12 +14,12 @@ using System.Collections.Generic; using System.Management.Automation; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; using System.Reflection; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidUsernameAndPasswordParams: Check that a function does not use both username and password diff --git a/Rules/AvoidUsingComputerNameHardcoded.cs b/Rules/AvoidUsingComputerNameHardcoded.cs index dab94246a..f0454d412 100644 --- a/Rules/AvoidUsingComputerNameHardcoded.cs +++ b/Rules/AvoidUsingComputerNameHardcoded.cs @@ -12,11 +12,11 @@ using System; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidUsingComputerNameHardcoded: Check that parameter ComputerName is not hardcoded. diff --git a/Rules/AvoidUsingConvertToSecureStringWithPlainText.cs b/Rules/AvoidUsingConvertToSecureStringWithPlainText.cs index 090dcb059..d9105235a 100644 --- a/Rules/AvoidUsingConvertToSecureStringWithPlainText.cs +++ b/Rules/AvoidUsingConvertToSecureStringWithPlainText.cs @@ -14,11 +14,11 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidUsingConvertToSecureStringWithPlainText: Check that convertto-securestring does not use plaintext. diff --git a/Rules/AvoidUsingInternalURLs.cs b/Rules/AvoidUsingInternalURLs.cs index 42f1692f8..99844de4f 100644 --- a/Rules/AvoidUsingInternalURLs.cs +++ b/Rules/AvoidUsingInternalURLs.cs @@ -14,12 +14,12 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; using System.IO; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidUsingInternalURLs: Check if a URL is potentially an internal URL, diff --git a/Rules/AvoidUsingInvokeExpression.cs b/Rules/AvoidUsingInvokeExpression.cs index 81db6dc7a..597383495 100644 --- a/Rules/AvoidUsingInvokeExpression.cs +++ b/Rules/AvoidUsingInvokeExpression.cs @@ -11,11 +11,11 @@ // using System; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// InvokeExpressionRule: Check to make sure that Invoke-Expression is not used. diff --git a/Rules/AvoidUsingPlainTextForPassword.cs b/Rules/AvoidUsingPlainTextForPassword.cs index 9cc2e1171..4e6366bff 100644 --- a/Rules/AvoidUsingPlainTextForPassword.cs +++ b/Rules/AvoidUsingPlainTextForPassword.cs @@ -13,12 +13,12 @@ using System; using System.Collections.Generic; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; using System.Reflection; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidUsingPlainTextForPassword: Check that parameter "password", "passphrase" do not use plaintext diff --git a/Rules/AvoidUsingWMICmdlet.cs b/Rules/AvoidUsingWMICmdlet.cs index 079f0ec14..d5104a298 100644 --- a/Rules/AvoidUsingWMICmdlet.cs +++ b/Rules/AvoidUsingWMICmdlet.cs @@ -11,21 +11,13 @@ // using System; -using System.Collections.ObjectModel; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Management.Automation; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; -using System.Resources; using System.Globalization; -using System.Threading; -using System.Reflection; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidUsingWMICmdlet: Avoid Using Get-WMIObject, Remove-WMIObject, Invoke-WmiMethod, Register-WmiEvent, Set-WmiInstance diff --git a/Rules/AvoidUsingWriteHost.cs b/Rules/AvoidUsingWriteHost.cs index fcc06a38b..e2339cb75 100644 --- a/Rules/AvoidUsingWriteHost.cs +++ b/Rules/AvoidUsingWriteHost.cs @@ -13,11 +13,11 @@ using System; using System.Collections.Generic; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// AvoidUsingWriteHost: Check that Write-Host or Console.Write are not used diff --git a/Rules/DscExamplesPresent.cs b/Rules/DscExamplesPresent.cs index 4d3129c4c..e0f9b53a1 100644 --- a/Rules/DscExamplesPresent.cs +++ b/Rules/DscExamplesPresent.cs @@ -14,13 +14,12 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; using System.IO; -using System.Management.Automation; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// DscExamplesPresent: Checks that DSC examples for given resource are present. diff --git a/Rules/DscTestsPresent.cs b/Rules/DscTestsPresent.cs index 15fbbda23..9a25ece36 100644 --- a/Rules/DscTestsPresent.cs +++ b/Rules/DscTestsPresent.cs @@ -14,13 +14,12 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; using System.IO; -using System.Management.Automation; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// DscTestsPresent: Checks that DSC tests for given resource are present. diff --git a/Rules/MissingModuleManifestField.cs b/Rules/MissingModuleManifestField.cs index 012c18069..9b0dd5954 100644 --- a/Rules/MissingModuleManifestField.cs +++ b/Rules/MissingModuleManifestField.cs @@ -12,14 +12,13 @@ using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Management.Automation.Language; using System.Management.Automation; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// MissingModuleManifestField: Run Test Module Manifest to check that none of the required fields are missing. diff --git a/Rules/PossibleIncorrectComparisonWithNull.cs b/Rules/PossibleIncorrectComparisonWithNull.cs index 507832322..da97c13f6 100644 --- a/Rules/PossibleIncorrectComparisonWithNull.cs +++ b/Rules/PossibleIncorrectComparisonWithNull.cs @@ -13,11 +13,11 @@ using System; using System.Collections.Generic; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// NullComparisonRule: Analyzes the ast to check that $null is on the left side of any equality comparisons. diff --git a/Rules/ProvideCommentHelp.cs b/Rules/ProvideCommentHelp.cs index fbb03b2b9..d98aa26aa 100644 --- a/Rules/ProvideCommentHelp.cs +++ b/Rules/ProvideCommentHelp.cs @@ -14,12 +14,12 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; using System.Management.Automation; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// ProvideCommentHelp: Analyzes ast to check that cmdlets have help. diff --git a/Rules/ProvideVerboseMessage.cs b/Rules/ProvideVerboseMessage.cs index fb4b3f15b..b3d191b56 100644 --- a/Rules/ProvideVerboseMessage.cs +++ b/Rules/ProvideVerboseMessage.cs @@ -14,12 +14,12 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; using System.Management.Automation; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// ProvideVerboseMessage: Analyzes the ast to check that Write-Verbose is called at least once in every cmdlet or script. diff --git a/Rules/ReturnCorrectTypesForDSCFunctions.cs b/Rules/ReturnCorrectTypesForDSCFunctions.cs index 90aeeeabc..127f12d6e 100644 --- a/Rules/ReturnCorrectTypesForDSCFunctions.cs +++ b/Rules/ReturnCorrectTypesForDSCFunctions.cs @@ -14,11 +14,11 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// ReturnCorrectTypeDSCFunctions: Check that DSC functions return the correct type. diff --git a/Rules/ScriptAnalyzerBuiltinRules.csproj b/Rules/ScriptAnalyzerBuiltinRules.csproj index 7401ac269..5f76f89c5 100644 --- a/Rules/ScriptAnalyzerBuiltinRules.csproj +++ b/Rules/ScriptAnalyzerBuiltinRules.csproj @@ -6,7 +6,7 @@ {C33B6B9D-E61C-45A3-9103-895FD82A5C1E} Library false - Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules + Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules v4.5 512 @@ -31,7 +31,7 @@ false - Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules + Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules @@ -58,7 +58,6 @@ - diff --git a/Rules/Strings.Designer.cs b/Rules/Strings.Designer.cs index 641440213..a748b432d 100644 --- a/Rules/Strings.Designer.cs +++ b/Rules/Strings.Designer.cs @@ -1,14 +1,14 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34014 +// Runtime Version:4.0.30319.35317 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules { +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { using System; @@ -39,7 +39,7 @@ internal Strings() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules.Strings", typeof(Strings).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.Strings", typeof(Strings).Assembly); resourceMan = temp; } return resourceMan; @@ -331,7 +331,7 @@ internal static string AvoidUnloadableModuleCommonName { } /// - /// Looks up a localized string similar to If a script file is in a Powershell module folder, then that folder must be loadable.. + /// Looks up a localized string similar to If a script file is in a PowerShell module folder, then that folder must be loadable.. /// internal static string AvoidUnloadableModuleDescription { get { diff --git a/Rules/Strings.resx b/Rules/Strings.resx index b26e4d6fa..833279fcc 100644 --- a/Rules/Strings.resx +++ b/Rules/Strings.resx @@ -295,7 +295,7 @@ Module Manifest Fields - If a script file is in a Powershell module folder, then that folder must be loadable. + If a script file is in a PowerShell module folder, then that folder must be loadable. Cannot load the module '{0}' that file '{1}' is in. diff --git a/Rules/UseApprovedVerbs.cs b/Rules/UseApprovedVerbs.cs index 833bf4f03..4a5ae083b 100644 --- a/Rules/UseApprovedVerbs.cs +++ b/Rules/UseApprovedVerbs.cs @@ -15,12 +15,12 @@ using System.Linq; using System.Management.Automation; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; using System.Reflection; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// UseApprovedVerbs: Analyzes scripts to check that all defined functions use approved verbs. diff --git a/Rules/UseCmdletCorrectly.cs b/Rules/UseCmdletCorrectly.cs index a5e854b0b..430e9a2d4 100644 --- a/Rules/UseCmdletCorrectly.cs +++ b/Rules/UseCmdletCorrectly.cs @@ -15,11 +15,11 @@ using System.Linq; using System.Management.Automation; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// Use CmdletCorrectly: Check that cmdlets are invoked with the correct mandatory parameter diff --git a/Rules/UseDeclaredVarsMoreThanAssignments.cs b/Rules/UseDeclaredVarsMoreThanAssignments.cs index b1b893497..1f1ecf089 100644 --- a/Rules/UseDeclaredVarsMoreThanAssignments.cs +++ b/Rules/UseDeclaredVarsMoreThanAssignments.cs @@ -13,11 +13,11 @@ using System; using System.Collections.Generic; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// ExtraVarsRule: Analyzes the ast to check that variables are used in more than just their assignment. diff --git a/Rules/UseIdenticalMandatoryParametersDSC.cs b/Rules/UseIdenticalMandatoryParametersDSC.cs index b2aaa3c16..f43c6f6c3 100644 --- a/Rules/UseIdenticalMandatoryParametersDSC.cs +++ b/Rules/UseIdenticalMandatoryParametersDSC.cs @@ -14,11 +14,11 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// UseIdenticalMandatoryParametersDSC: Check that the Get/Test/Set TargetResource diff --git a/Rules/UseIdenticalParametersDSC.cs b/Rules/UseIdenticalParametersDSC.cs index 8318c6155..99b9fac5e 100644 --- a/Rules/UseIdenticalParametersDSC.cs +++ b/Rules/UseIdenticalParametersDSC.cs @@ -14,11 +14,11 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// UseIdenticalParametersDSC: Check that the Test-TargetResource and diff --git a/Rules/UseOutputTypeCorrectly.cs b/Rules/UseOutputTypeCorrectly.cs index 5d04de225..a41c3a23c 100644 --- a/Rules/UseOutputTypeCorrectly.cs +++ b/Rules/UseOutputTypeCorrectly.cs @@ -14,12 +14,12 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; using System.Management.Automation; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// ProvideCommentHelp: Checks that objects return in a cmdlet have their types declared in OutputType Attribute diff --git a/Rules/UsePSCredentialType.cs b/Rules/UsePSCredentialType.cs index a932686d4..99ddbd70f 100644 --- a/Rules/UsePSCredentialType.cs +++ b/Rules/UsePSCredentialType.cs @@ -14,11 +14,11 @@ using System.Collections.Generic; using System.Management.Automation; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// diff --git a/Rules/UseShouldProcessCorrectly.cs b/Rules/UseShouldProcessCorrectly.cs index de40351cc..fef838fd0 100644 --- a/Rules/UseShouldProcessCorrectly.cs +++ b/Rules/UseShouldProcessCorrectly.cs @@ -13,11 +13,11 @@ using System; using System.Collections.Generic; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// UseShouldProcessCorrectly: Analyzes the ast to check that if the ShouldProcess attribute is present, the function calls ShouldProcess and vice versa. diff --git a/Rules/UseShouldProcessForStateChangingFunctions.cs b/Rules/UseShouldProcessForStateChangingFunctions.cs index 28c50aca4..c4fcf8449 100644 --- a/Rules/UseShouldProcessForStateChangingFunctions.cs +++ b/Rules/UseShouldProcessForStateChangingFunctions.cs @@ -15,11 +15,11 @@ using System.Linq; using System.Management.Automation; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules {/// /// UseShouldProcessCorrectly: Analyzes the ast to check that if the ShouldProcess attribute is present, the function calls ShouldProcess and vice versa. /// diff --git a/Rules/UseSingularNouns.cs b/Rules/UseSingularNouns.cs index 89d7d3095..78ecf16fd 100644 --- a/Rules/UseSingularNouns.cs +++ b/Rules/UseSingularNouns.cs @@ -13,13 +13,12 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Management.Automation; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// CmdletSingularNoun: Analyzes scripts to check that all defined cmdlets use singular nouns. diff --git a/Rules/UseStandardDSCFunctionsInResource.cs b/Rules/UseStandardDSCFunctionsInResource.cs index 67e9728df..d8091eacb 100644 --- a/Rules/UseStandardDSCFunctionsInResource.cs +++ b/Rules/UseStandardDSCFunctionsInResource.cs @@ -14,11 +14,11 @@ using System.Collections.Generic; using System.Linq; using System.Management.Automation.Language; -using Microsoft.Windows.Powershell.ScriptAnalyzer.Generic; +using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic; using System.ComponentModel.Composition; using System.Globalization; -namespace Microsoft.Windows.Powershell.ScriptAnalyzer.BuiltinRules +namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules { /// /// UseStandardDSCFunctionsInResource: diff --git a/Tests/Rules/AvoidTrapStatements.ps1 b/Tests/Disabled Rules/AvoidTrapStatements.ps1 similarity index 100% rename from Tests/Rules/AvoidTrapStatements.ps1 rename to Tests/Disabled Rules/AvoidTrapStatements.ps1 diff --git a/Tests/Rules/AvoidTrapStatements.tests.ps1 b/Tests/Disabled Rules/AvoidTrapStatements.tests.ps1 similarity index 100% rename from Tests/Rules/AvoidTrapStatements.tests.ps1 rename to Tests/Disabled Rules/AvoidTrapStatements.tests.ps1