├── Chapter01 ├── 4.1.1_Get-Help.ps1 ├── 4.1.2_UpdatableHelp.ps1 ├── 4.2.10_Get-Help_Detailed.ps1 ├── 4.2.11_Get-Help_Full.ps1 ├── 4.2.1_Get-Help.ps1 ├── 4.2.2_Get-Help_more.ps1 ├── 4.2.3_Get-Help_ShowWindow.ps1 ├── 4.2.4_Get-Help_All.ps1 ├── 4.2.5_Get-Help_Example.ps1 ├── 4.2.6_Get-Help_Online.ps1 ├── 4.2.7_Get-Help_Get-Process.ps1 ├── 4.2.8_Get-Help_Examples.ps1 ├── 4.2.9_Get-Help_Parameter.ps1 ├── 4.3.1_Save-Help.ps1 ├── 4.3.2_Save-Help_All.ps1 ├── 4.4.1_Update-Help.ps1 ├── 4.4.2_Update-Help_SingleModule.ps1 ├── 4.4.3_Update-Help_ImportHelp.ps1 ├── 4.4.4_Update-Help_WrongCulture.ps1 ├── 4.4.5_Update-Help_NamedCulture.ps1 ├── 4.5.1_Get-Help_About.ps1 ├── 5.1.1_Get-Verb.ps1 ├── 5.3.1_Get-Command.ps1 ├── 5.3.2_Get-Command_Wildcards.ps1 ├── 5.4.1_Get-Alias.ps1 ├── 5.4.2_Get-Alias_ByName.ps1 ├── 5.5.2_Get-Alias_ByDefinition.ps1 ├── 5.5.3_AliasUse.ps1 ├── 5.5.4_New-Alias.ps1 ├── 6.1.1_PositionalParams.ps1 ├── 6.1.2_MandatoryNamedParams.ps1 ├── 6.1.3_MandatoryPositionalParams.ps1 ├── 6.1.4_MultipleMandatoryPositionalParams.ps1 ├── 6.1.5_SwitchParam.ps1 ├── 6.1.6_CommonParams.ps1 ├── 6.1.7_Verbose.ps1 ├── 6.2.1_ParameterValues.ps1 ├── 6.2.2_ParameterValues_Array.ps1 ├── 6.3.1_ParameterSets.ps1 ├── 6.3.2_ParameterSetSelection.ps1 ├── 6.4.10_BypassingWhatIf.ps1 ├── 6.4.11_WhatIfPreference.ps1 ├── 6.4.12_ConfirmAndWhatIfPreference.ps1 ├── 6.4.1_PreferenceVariables.ps1 ├── 6.4.2_Force.ps1 ├── 6.4.3_Confirm.ps1 ├── 6.4.4_Confirm_False.ps1 ├── 6.4.5_Clear-RecycleBin_Confirm.ps1 ├── 6.4.6_Clear-RecycleBin_Confirm_False.ps1 ├── 6.4.7_ConfirmPreference.ps1 ├── 6.4.8_ConfirmPreference_Set.ps1 ├── 6.4.9_WhatIf.ps1 ├── 6.5.13_Force_Error.ps1 ├── 6.5.14_UsingForce.ps1 ├── 7.1.1_Providers.ps1 ├── 7.1.2_Get-PSProvider.ps1 ├── 7.1.3_ProviderHelp.ps1 ├── 7.1.4_ProviderHelpCategory.ps1 ├── 7.2.1_Get-PSDrive.ps1 ├── 7.2.2_CertProvider.ps1 ├── 7.2.3_New-PSDrive.ps1 ├── 7.2.4_Get-ChildItem_HKU.ps1 ├── 7.3.1_UsingProviders_FileSystem.ps1 ├── 7.4.1_UsingProviders_Certificate.ps1 ├── 8.1.1_Splatting.ps1 ├── 8.1.2_Splatting_CallOperator.ps1 ├── 8.1.3_Splatting_CallOperator.ps1 ├── 8.2.1_LongCommand.ps1 ├── 8.2.2_UsingTick.ps1 ├── 8.2.3_Splatting_Register-ScheduledTask.ps1 ├── 8.3.1_MultipleSplattingVariables.ps1 ├── 8.4.1_ExampleCommand.ps1 └── 8.4.2_PositionalSplatting.ps1 ├── Chapter02 ├── 1.1.1_New-Module.ps1 ├── 1.2.1_Get-Module.ps1 ├── 1.2.2_Get-Module_ListAvailable.ps1 ├── 1.3.1_PSMODULEPATH.ps1 ├── 1.3.2_Set_PSMODULEPATH.ps1 ├── 1.3.3_PSMODULEPATH_PSCore.ps1 ├── 1.3.4_Import-Module_PSCore.ps1 ├── 2.1.1_Autoloading.ps1 ├── 2.1.2_Import-Module.ps1 ├── 2.1.3_Get-Command.ps1 ├── 2.1.4_Import-Module_MaximumVersion.ps1 ├── 2.3.1_Find-Module.ps1 ├── 2.3.2_Find-Module_Filter.ps1 ├── 2.4.1_Install-Module.ps1 ├── 2.4.2_Install-Module_Scope.ps1 ├── 2.4.3_Install-Module_Scope_Force.ps1 ├── 2.4.4_Install-Module_Reinstall.ps1 ├── 2.6.1_Save-Module.ps1 ├── 3.1.1_InstallWindowsCompatibility.ps1 ├── 4.1.1_Get-PSSnapIn.ps1 ├── 4.2.1_Add-PSSnapIn.ps1 └── 4.2.3_Get-Command_SnapIn.ps1 ├── Chapter03 ├── 1.1.1.StdOut.ps1 ├── 1.2.1.StdOut.ps1 ├── 1.3.1.StdOut.ps1 ├── 2.1.1.Get-Member.ps1 ├── 2.1.2.Get-Member_MemberType.ps1 ├── 2.2.1.Property.ps1 ├── 2.2.2.Property_Parens.ps1 ├── 2.2.3.Property_Sub-property.ps1 ├── 2.2.4.Property_Sub-property_Parens.ps1 ├── 2.2.5.Property_with_spaces.ps1 ├── 2.2.6.Property_with_variable.ps1 ├── 2.3.1.Method_show.ps1 ├── 2.3.2.Method_invoke.ps1 ├── 2.3.3.Method_arguments.ps1 ├── 2.3.4.Method_results.ps1 ├── 2.3.5.Method_close.ps1 ├── 2.3.6.Method_ToString.ps1 ├── 2.3.7.Get-Date_Format_alternative.ps1 ├── 2.3.8.Method_chaining.ps1 ├── 2.4.1.AccessModifiers.ps1 ├── 2.4.2.AccessModifiers_ReadOnly.ps1 ├── 2.4.3.AccessModifiers_Set.ps1 ├── 2.4.4.AccessModifiers_Result.ps1 ├── 2.5.1.Add-Member_NoteProperty.ps1 ├── 2.5.2.Add-Member_ScriptProperty.ps1 ├── 2.5.3.Add-Member_ScriptMethod.ps1 ├── 3.1.1.Get-PSDrive_Example.ps1 ├── 3.2.1.ForEach-Object.ps1 ├── 3.2.2.ForEach-Object_MemberExpansion.ps1 ├── 3.2.3.ForEach-Object_MemberInvocation.ps1 ├── 3.3.1.Where-Object.ps1 ├── 3.3.2.Where-Object_OddOrder.ps1 ├── 3.3.3.Where-Object_FilterScript.ps1 ├── 3.3.4.Where-Object_OrderedExpressions.ps1 ├── 4.1.1.Select-Object.ps1 ├── 4.1.10.Select-Object_Unique_Property.ps1 ├── 4.1.11.Select-Object_PropertySet.ps1 ├── 4.1.12.Select-Object_CalculatedProperties.ps1 ├── 4.1.2.Select-Object_Wildcards.ps1 ├── 4.1.3.Select-Object_Exclude_Wildcards.ps1 ├── 4.1.4.Select-Object_First.ps1 ├── 4.1.5.Select-Object_Last.ps1 ├── 4.1.6.Select-Object_Skip.ps1 ├── 4.1.7.Select-Object_ExpandProperty.ps1 ├── 4.1.8.Select-Object_Unique.ps1 ├── 4.1.9.ExampleSet.ps1 ├── 4.2.1.Sort-Object.ps1 ├── 4.2.2.Sort-Object_CaseInsensitive.ps1 ├── 4.2.3.Sort-Object_Property.ps1 ├── 4.2.4.Sort-Object_MultipleProperties.ps1 ├── 4.2.5.ExamResults_Result.ps1 ├── 4.2.6.ExamResults_ResultAndMark.ps1 ├── 4.2.7.ExamResults_ResultAndMark_Descending.ps1 ├── 4.2.8.ExamResults_ResultAscdending_MarkDescending.ps1 ├── 5.1.1.Group-Object.ps1 ├── 5.1.2.Group-Object_NoElement.ps1 ├── 5.1.3.Group-Object_Property.ps1 ├── 5.1.4.Group-Object_Pipeline.ps1 ├── 5.1.5.Group-Object_Pipeline_MultipleProperties.ps1 ├── 5.1.6.Group-Object_ScriptBlock.ps1 ├── 5.1.7.Group-Object_AsHashtable.ps1 ├── 5.1.8.Group-Object_CaseSensitive.ps1 ├── 5.2.1.Measure-Object.ps1 ├── 5.2.2.Measure-Object_Sum.ps1 ├── 5.2.3.Measure-Object_All.ps1 ├── 5.2.4.Measure-Object_Property.ps1 ├── 5.2.5.Measure-Object_WordAndCharacter.ps1 ├── 6.1.1.Compare-Object.ps1 ├── 6.1.2.Compare-Object_SideIndicator.ps1 ├── 6.1.3.Compare-Object_IncludeEqual.ps1 ├── 6.1.4.Compare-Object_ExcludeDifferent_PassThru.ps1 ├── 6.1.5.Compare-Object_MultipleProprerties.ps1 ├── 6.1.6.Compare-Object_AvoidingNull.ps1 ├── 7.1.1.Export-Csv.ps1 ├── 7.1.2.Export-Csv_Append_TypeMismatch.ps1 ├── 7.1.3.Export-Csv_Append.ps1 ├── 7.1.4.Export-Csv_NoTypeInformation.ps1 ├── 7.1.5.ConvertTo-Csv.ps1 ├── 7.1.6.ConvertTo-Csv_Arrays.ps1 ├── 7.1.7.ConvertTo-Csv_Arrays_Why.ps1 ├── 7.1.8.ConvertTo-Csv_Arrays_Conversion.ps1 ├── 7.2.1.Import-Csv.ps1 ├── 7.2.2.Import-Csv_Sort-Object.ps1 ├── 7.2.3.Import-Csv_Sort-Object_Casting.ps1 ├── 7.2.4.ConvertFrom-Csv.ps1 ├── 7.3.1.Export-CliXml.ps1 ├── 7.3.2.Import-CliXml.ps1 └── 7.3.3.Import-CliXml_GetType.ps1 ├── Chapter04 ├── 1.1.1.OperatorPrecedence.ps1 ├── 1.1.2.OperatorPrecedence_Shift.ps1 ├── 1.1.3.OperatorPrecedence_Parens.ps1 ├── 1.2.1.Addition_Simple.ps1 ├── 1.2.2.Concatenation.ps1 ├── 1.2.3.Concatenation_casting.ps1 ├── 1.2.4.Concatenation_lhs_wins.ps1 ├── 1.2.5.Concatenation_lhs_wins.ps1 ├── 1.2.6.JoinArray.ps1 ├── 1.2.7.JoinArray_Examples.ps1 ├── 1.2.8.JoinHashtable.ps1 ├── 1.2.9.JoinHashtable_DuplicateKeys.ps1 ├── 1.3.1.Subtraction.ps1 ├── 1.4.1.Multiplication.ps1 ├── 1.4.2.Multiplication_Strings.ps1 ├── 1.4.3.Multiplication_Strings_IncorrectOrder.ps1 ├── 1.4.4.ArrayMultiplication.ps1 ├── 1.5.1.Division.ps1 ├── 1.5.2.Division_DivideByZero.ps1 ├── 1.6.1.Remainder.ps1 ├── 1.6.2.Remainder_Alternation.ps1 ├── 1.7.1.LeftShift.ps1 ├── 1.7.2.RightShift.ps1 ├── 1.7.3.shl_OutOfRange.ps1 ├── 1.7.4.shl_OutOfRange_Byte.ps1 ├── 1.7.5.shl_Int16.ps1 ├── 1.7.6.shl_SIgning.ps1 ├── 1.7.7.shl_IPAddress.ps1 ├── 2.1.1.Assignment.ps1 ├── 2.1.10.AddArrayToArray.ps1 ├── 2.1.11.AddToHashtable.ps1 ├── 2.1.12.SubtractAndAssign.ps1 ├── 2.1.2.Assignment_Property.ps1 ├── 2.1.3.AddAndAssign.ps1 ├── 2.1.4.AddAndAssign_Equivalent.ps1 ├── 2.1.5.ConcatenateAndAssign.ps1 ├── 2.1.7.TypeMismatch.ps1 ├── 2.1.8.CastToString.ps1 ├── 2.1.9.AddToArray.ps1 ├── 2.2.1.MultiplyAndAssign.ps1 ├── 2.2.2.MultiplyStringAndAssign.ps1 ├── 2.2.3.MultiplyStringAndAssign_Error.ps1 ├── 2.2.4.MultiplyArrayAndAssign.ps1 ├── 2.2.5.DivideAndAssign.ps1 ├── 2.2.6.RemainderAndAssign.ps1 ├── 3.1.1.Equals.ps1 ├── 3.1.2.CaseSensitiveEquals.ps1 ├── 3.1.3.ExplicitCaseInsensitiveEquals.ps1 ├── 3.2.1.ComparisonAndArrays.ps1 ├── 3.2.2.ArrayEqualsNull.ps1 ├── 3.2.3.ArrayEqualsNull_InvalidComparison.ps1 ├── 3.2.4.ImplicitBoolean.ps1 ├── 3.2.5.NullEqualsArray.ps1 ├── 3.3.1.Equal_Examples.ps1 ├── 3.3.2.NotEqual_Examples.ps1 ├── 3.4.1.LikeAndNotLike.ps1 ├── 3.5.1.GreaterThanAndLessThan.ps1 ├── 3.5.2.GreaterThanAndLessThan_Alphabetical_CaseInsensitive.ps1 ├── 3.5.3.GreaterThanAndLessThan_Alphabetical_CaseSensitive.ps1 ├── 3.6.1.ContainsAndNotContains.ps1 ├── 3.6.2.In.ps1 ├── 4.1.1.Match.ps1 ├── 4.1.2.MatchAndMatches.ps1 ├── 4.1.3.MatchAndNumberedGroups.ps1 ├── 4.2.1.Replace.ps1 ├── 4.2.2.ReplaceWithNothing.ps1 ├── 4.2.3.ReplaceWithTokens.ps1 ├── 4.2.4.ReplaceWithTokens_DoubleQuotes.ps1 ├── 4.3.1.Split.ps1 ├── 5.1.1.BinaryAnd.ps1 ├── 5.2.1.BinaryOr.ps1 ├── 5.3.1.BinaryExclusiveOr.ps1 ├── 5.3.2.BinaryExclusiveOr_Toggle.ps1 ├── 5.4.1.BinaryNot.ps1 ├── 6.1.1.And.ps1 ├── 6.2.1.Or.ps1 ├── 6.3.1.ExclusiveOr.ps1 ├── 6.4.1.Not.ps1 ├── 7.1.1.As.ps1 ├── 7.1.2.As_TestForType.ps1 ├── 7.2.1.IsAndIsNot.ps1 ├── 8.1.1.RedirectIntroduction.ps1 ├── 8.2.1.RedirectToFile.ps1 ├── 8.2.2.RedirectToFile_Append.ps1 ├── 8.2.3.RedirectToFile_Multiple.ps1 ├── 8.2.4.RedirectFile_AllStreams.ps1 ├── 8.3.1.RedirectToStandardOut.ps1 ├── 8.3.2.RedirectMultipleToStandardOut.ps1 ├── 8.4.1.RedirectToNull.ps1 ├── 8.4.2.RedirectToNull_EmptyString.ps1 ├── 8.4.3.RedirectMultipleToNull.ps1 ├── 9.1.1.Call.ps1 ├── 9.1.2.CallScriptBlock.ps1 ├── 9.1.3.CallCommandAsString.ps1 ├── 9.2.1.Comma.ps1 ├── 9.2.2.SingleElementArray.ps1 ├── 9.3.1.Format.ps1 ├── 9.3.2.Format_Percentage.ps1 ├── 9.3.3.Format_Hex.ps1 ├── 9.3.4.Format_Currency.ps1 ├── 9.4.1.PostIncrement.ps1 ├── 9.4.2.PostDecrement.ps1 ├── 9.4.3.PostIncrementExample.ps1 ├── 9.4.4.PreIncrementExample.ps1 ├── 9.5.1.Join.ps1 └── 9.5.2.JoinNoSeparator.ps1 ├── Chapter05 ├── 1.1.1.VariableNames.ps1 ├── 1.1.2.VariableWithCurlyBraces.ps1 ├── 1.1.3.Interpolation.ps1 ├── 1.1.4.FileSystemProvider.ps1 ├── 1.1.5.Assignment.ps1 ├── 1.1.6.AssignmentMultiple.ps1 ├── 2.1.1.Clear-Variable.ps1 ├── 2.2.1.Get-Variable.ps1 ├── 2.3.1.New-Variable.ps1 ├── 2.3.2.New-Variable_Equivalent.ps1 ├── 2.3.3.New-Variable_Constant.ps1 ├── 2.4.1.Remove-Variable.ps1 ├── 2.4.2.Remove-Variable_ReferenceOnly.ps1 ├── 2.5.1.Set-Variable.ps1 ├── 2.5.2.Set-Variable_Private.ps1 ├── 2.6.5.VariableProvider_Get-Item.ps1 ├── 3.1.1.VariableProvider.ps1 ├── 3.1.2.VariableProvider_Test-Path.ps1 ├── 3.1.3.VariableProvider_Set-Item.ps1 ├── 3.1.4.VariableProvider_Get-Content.ps1 ├── 4.1.1.Scope.ps1 ├── 4.1.2.Scope_Parent.ps1 ├── 4.2.1.Scope_Private.ps1 ├── 4.2.2.Scope_Private_Demo.ps1 ├── 4.2.3.Scope_Private_Layers.ps1 ├── 4.3.1.Scope_Script.ps1 ├── 5.1.1.TypeConversion_ToString.ps1 ├── 5.1.2.TypeConversion_ToDateTime.ps1 ├── 5.1.3.AssignedType.ps1 ├── 5.1.4.ArgumentConverterAttribute.ps1 ├── 5.1.5.TypePersistence.ps1 ├── 6.1.1.ValueTypeAssignment.ps1 ├── 6.1.2.ValueTypeAssignment_Deviation.ps1 ├── 6.1.3.ReferenceTypeAssignment.ps1 ├── 6.1.4.ReferenceTypeAssignment_PropertyChange.ps1 ├── 6.1.5.ReferenceTypeAssignment_PropertyChange_Nested.ps1 ├── 7.1.1.CreateArray.ps1 ├── 7.1.2.CreateArrayOfSize.ps1 ├── 7.1.3.ArrayOfElements.ps1 ├── 7.1.4.ArrayOfElements_Alternate.ps1 ├── 7.1.5.ArrayOfElements_Multiline.ps1 ├── 7.1.6.ArrayOfElements_MixedType.ps1 ├── 7.2.1.ArrayOfType.ps1 ├── 7.2.2.ArrayOfType_TypeMismatch.ps1 ├── 7.3.1.AddElement.ps1 ├── 7.3.2.AddElement_Equivalent.ps1 ├── 7.3.3.AddElement_Equivalent.ps1 ├── 7.4.1.GetByIndex.ps1 ├── 7.4.2.IndexFromEnd.ps1 ├── 7.4.3.IndexRange.ps1 ├── 7.4.4.ArrayOfIndexes.ps1 ├── 7.4.5.ArrayOfIndexes_FirstMustBeArray.ps1 ├── 7.4.6.ArrayOfIndexes_FirstMustBeArray_Cause.ps1 ├── 7.4.7.ArrayOfIndexes_FirstMustBeArray_Fix.ps1 ├── 7.5.1.Updating.ps1 ├── 7.5.2.UpdatingInLoop.ps1 ├── 7.6.1.RemovingElements_NullElements.ps1 ├── 7.6.10.RemovingElements_ByValue_Start.ps1 ├── 7.6.11.RemovingElements_ByValue_Where-Object.ps1 ├── 7.6.12.RemovingElements_ByValue_IndexOf.ps1 ├── 7.6.13.RemovingElements_ByValue_IndexOf_New.ps1 ├── 7.6.14.Clear.ps1 ├── 7.6.2.RemovingElements_NullElements_Count.ps1 ├── 7.6.3.RemovingElements_NullElements_Count.ps1 ├── 7.6.4.RemovingElements_NullElements_Pipeline.ps1 ├── 7.6.5.RemovingElements_NullElements_Where-Object.ps1 ├── 7.6.6.RemovingElements_ByIndex.ps1 ├── 7.6.7.RemovingElements_ByIndex_NewArray.ps1 ├── 7.6.8.RemovingElements_ArrayCopy.ps1 ├── 7.6.9.RemovingElements_UsingLoop.ps1 ├── 7.7.1.SetVariablesFromArray.ps1 ├── 7.7.2.SetVariablesFromArray_Split.ps1 ├── 7.7.3.SetVariablesFromArray_Overflow.ps1 ├── 7.7.4.SetVariablesFromArray_Underrun.ps1 ├── 7.8.1.MultiDimensionalArray.ps1 ├── 7.8.2.MultiDimensionalArray_AccessingElements.ps1 ├── 7.8.3.MultiDimensionalArray_AccessingElements_2.ps1 ├── 7.8.4.JaggedArray.ps1 ├── 7.8.5.JaggedArray_AccessingElements.ps1 ├── 8.0.1.CommandsUsingHashtables.ps1 ├── 8.1.1.CreateEmptyHashtable.ps1 ├── 8.1.2.CreateHashtableWithKeys.ps1 ├── 8.1.3.CreateHashtableWithKeys_Multiline.ps1 ├── 8.2.1.AddMethod.ps1 ├── 8.2.10.Keys_ForEach-Object.ps1 ├── 8.2.2.AddMethod_ExistingKey.ps1 ├── 8.2.3.ContainsMethod.ps1 ├── 8.2.4.ImplicitAdd.ps1 ├── 8.2.5.ImplicitAdd_PropertyNotation.ps1 ├── 8.2.6.UpdateOnly.ps1 ├── 8.2.7.AddOnly.ps1 ├── 8.2.8.CannotModifyCollection.ps1 ├── 8.2.9.KeysArray.ps1 ├── 8.3.1.AccessKey.ps1 ├── 8.3.2.AccessKey_Alternative.ps1 ├── 8.3.3.AccessKey_IntegerKey.ps1 ├── 8.3.4.AccessKey_IntegerKey_Failure.ps1 ├── 8.4.1.Start.ps1 ├── 8.4.2.KeysProperty.ps1 ├── 8.4.3.ValuesProperty.ps1 ├── 8.4.4.Loop.ps1 ├── 8.5.1.RemoveMethod.ps1 ├── 8.5.2.CannotModifyCollection.ps1 ├── 8.5.3.ClearMethod.ps1 ├── 9.1.1.List.ps1 ├── 9.1.10.RemoveAll.ps1 ├── 9.1.11.Reassign.ps1 ├── 9.1.2.ArrayList.ps1 ├── 9.1.3.AddMethod.ps1 ├── 9.1.4.InsertMethod.ps1 ├── 9.1.5.AddRange_And_Index.ps1 ├── 9.1.6.FindIndex.ps1 ├── 9.1.7.IndexOf.ps1 ├── 9.1.8.BinarySearch.ps1 ├── 9.1.9.RemoveAndRemoveAt.ps1 ├── 9.2.1.Dictionary.ps1 ├── 9.2.10.EnumerateDictionary_Start.ps1 ├── 9.2.11.KeysProperty.ps1 ├── 9.2.12.ValuesProperty.ps1 ├── 9.2.13.Loop.ps1 ├── 9.2.14.RemoveMethod.ps1 ├── 9.2.2.AddMethod.ps1 ├── 9.2.3.ContainsKey.ps1 ├── 9.2.4.PropertyNotation.ps1 ├── 9.2.5.StronglyTypedKey.ps1 ├── 9.2.6.StronglyTypedKey_Usage.ps1 ├── 9.2.7.AccessByKey.ps1 ├── 9.2.8.AccessByKey_StronglyTypedKey.ps1 ├── 9.2.9.AccessByKey_StronglyTypedKey_Usage.ps1 ├── 9.3.1.Queue.ps1 ├── 9.3.2.EnumerateQueue.ps1 ├── 9.3.3.PeekMethod.ps1 ├── 9.3.4.EnqueueMethod.ps1 ├── 9.3.5.DequeueMethod.ps1 ├── 9.3.6.DequeueMethod_Empty.ps1 ├── 9.3.7.DequeueMethod_Empty_Count.ps1 ├── 9.4.1.Stack.ps1 ├── 9.4.2.EnumerateStack.ps1 ├── 9.4.3.PeekMethod.ps1 ├── 9.4.4.PushMethod.ps1 ├── 9.4.5.PopMethod.ps1 ├── 9.4.6.PopMethod_Empty.ps1 └── 9.4.7.PopMethod_Empty_Count.ps1 ├── Chapter06 ├── 1.1.1.If.ps1 ├── 1.1.2.ImplicitBoolean.ps1 ├── 1.1.3.BooleanCastTrue.ps1 ├── 1.1.4.BooleanCastFalse.ps1 ├── 1.1.5.IfAndAssign.ps1 ├── 1.1.6.IfAndAssign_Practical.ps1 ├── 1.2.1.Switch.ps1 ├── 1.2.2.Switch_Break.ps1 ├── 1.2.3.Switch_Default.ps1 ├── 1.2.4.Switch_Array.ps1 ├── 1.2.5.Switch_Array_Break.ps1 ├── 1.2.6.Switch_Wildcard.ps1 ├── 1.2.7.Switch_Regex.ps1 ├── 1.2.8.Switch_Expression.ps1 ├── 2.1.1.foreach.ps1 ├── 2.2.1.for.ps1 ├── 2.2.2.for_Step.ps1 ├── 2.2.3.for_Step_Decrement.ps1 ├── 2.3.1.do_until.ps1 ├── 2.3.2.do_while.ps1 ├── 2.4.1.while.ps1 ├── 2.5.1.break.ps1 ├── 2.5.2.break_nested.ps1 ├── 2.5.3.continue.ps1 ├── 3.1.1.AssignSwitch.ps1 ├── 3.1.2.foreach_badpractice.ps1 └── 3.1.3.foreach_goodpractice.ps1 ├── Chapter07 ├── 1.1.1.GetAssemblies.ps1 ├── 1.1.2.GetAssemblyForType.ps1 ├── 1.1.3.GetAssemblyForType_Others.ps1 ├── 2.1.1.GetAssemblies_ImplicitSystemNamespace.ps1 ├── 2.1.2.GetAssemblies_ImplicitSystemNamespace_2.ps1 ├── 5.1.1.Constructors.ps1 ├── 5.1.2.Constructors_GetConstructors.ps1 ├── 5.2.1.newMethod.ps1 ├── 5.2.10.ArgumentsAsAnArray_newMethod_Failure.ps1 ├── 5.2.11.ArgumentsAsAnArray_newMethod.ps1 ├── 5.2.12.New-Object_ArgumentList_Failure.ps1 ├── 5.2.13.newMethod_ArgumentList_Working.ps1 ├── 5.2.14.New-Object_Fix.ps1 ├── 5.2.15.ChainCasting.ps1 ├── 5.2.2.New-Object.ps1 ├── 5.2.3.New-Object_StringBuilder.ps1 ├── 5.2.4.New-Object_ArgumentList.ps1 ├── 5.2.5.Alternatives.ps1 ├── 5.2.6.ContructorSelection.ps1 ├── 5.2.7.ContructorSelection_Coercion.ps1 ├── 5.2.8.ContructorSelection_Coercion_Failure.ps1 ├── 5.2.9.ArgumentsAsAnArray.ps1 ├── 5.3.1.CreationFromHashtable_Constructor.ps1 ├── 5.3.2.CreationFromHashtable.ps1 ├── 6.2.1.StaticProperties.ps1 ├── 6.2.2.StaticPropertyInvocation.ps1 ├── 6.2.3.StaticPropertyInvocation_FromVariable.ps1 ├── 6.2.4.StaticFields.ps1 ├── 6.3.1.StaticMethods.ps1 ├── 6.3.2.StaticMethodInvocation.ps1 ├── 6.3.3.StaticMethodInvocation_FromVariable.ps1 ├── 6.3.4.StaticMethodInvocation_Arguments.ps1 ├── 6.3.5.StaticMethodInvocation_ArgumentList_Failure.ps1 ├── 6.3.6.StaticMethodInvocation_ArgumentList_InvokeMethod.ps1 ├── 6.3.7.StaticMethod_OverloadDefinition.ps1 ├── 7.1.1.NonPublicClasses.ps1 ├── 8.1.1.TypeAccelerators_PowerShell.ps1 ├── 8.1.2.TypeAccelerators_ADSI.ps1 ├── 8.1.3.TypeAccelerators_Listing.ps1 ├── 8.1.4.TypeAccelerators_Adding.ps1 ├── 8.1.5.Accelerators_Get.ps1 ├── 9.1.1.UsingAssembly.ps1 ├── 9.1.2.Add-Type.ps1 ├── 9.1.3.gacutil.ps1 ├── 9.1.4.GacModule.ps1 ├── 9.1.5.UsingAssembly_Specific.ps1 ├── 9.1.6.AssemblyFullName.ps1 ├── 9.1.7.UsingAssemblyPath.ps1 ├── 9.2.1.UsingNamespace.ps1 ├── 9.2.2.UsingNamespace_Result.ps1 ├── 9.2.3.UsingNamespace_Example.ps1 └── 9.2.4.UsingMultipleNamespaces.ps1 ├── Chapter08 ├── 1.1.1.IndexIntoString.ps1 ├── 1.1.2.StringTrimMethodOnArray.ps1 ├── 1.1.3.StringSplitMethodOnArray.ps1 ├── 1.1.4.StringMethodsOnUnrolledArray.ps1 ├── 1.1.5.AddDaysMethodArrayOfDateTime.ps1 ├── 1.1.6.DayOfWeekPropertyArrayOfDateTime.ps1 ├── 1.1.7.DayOfWeekPropertyArrayOfDateTime.ps1 ├── 1.1.8.DateTimeMethodsOnUnrolledArray.ps1 ├── 1.10.1.Contains.ps1 ├── 1.10.2.StartsWithAndEndsWith.ps1 ├── 1.11.1.MethodChaining.ps1 ├── 1.2.1.Substring.ps1 ├── 1.2.2.Substring_StartAndLength.ps1 ├── 1.3.1.Split.ps1 ├── 1.3.2.Split_EmptyEntries.ps1 ├── 1.3.3.Split_RemoveEmptyEntries.ps1 ├── 1.3.4.Split_RemoveEmptyEntries_Assign.ps1 ├── 1.3.5.SplitMethodOverloads.ps1 ├── 1.3.6.CharArray.ps1 ├── 1.3.7.SplitChoosesCharArray.ps1 ├── 1.3.8.ForceSplitString.ps1 ├── 1.4.1.Replace.ps1 ├── 1.4.2.Replace_vs_-replace.ps1 ├── 1.5.1.Trim.ps1 ├── 1.5.2.Trim_ArrayOfChar.ps1 ├── 1.5.3.Trim_Overloads.ps1 ├── 1.5.4.TrimEndTooFar.ps1 ├── 1.6.1.Insert.ps1 ├── 1.6.2.Remove.ps1 ├── 1.7.1.IndexOfAndLastIndexOf.ps1 ├── 1.7.2.IndexOfAndIf.ps1 ├── 1.7.3.IndexOfAndSubstring.ps1 ├── 1.8.1.PadLeftAndPadRight.ps1 ├── 1.8.2.PadRight.ps1 ├── 1.8.3.PadLeft.ps1 ├── 1.9.1.ToUpperAndToLower.ps1 ├── 1.9.2.ToLowerAndReplace.ps1 ├── 1.9.3.ToTitleCase.ps1 ├── 1.9.4.ToTitleCase_Alternative.ps1 ├── 2.1.1.ToBase64String.ps1 ├── 2.1.2.ToBase64String_ASCII.ps1 ├── 2.1.3.ToBase64String_CharArray.ps1 ├── 2.1.4.ToBase64String_Unicode.ps1 ├── 2.1.5.Base64AndPSCredential.ps1 ├── 2.2.1.ConvertTo-Csv.ps1 ├── 2.2.2.ConvertFrom-Csv.ps1 ├── 2.2.3.ConvertFrom-Csv_MultilineField.ps1 ├── 2.2.4.ConvertFrom-Csv_FirstLineIsHeader.ps1 ├── 2.2.5.Export-CsvAndImport-Csv.ps1 ├── 2.3.1.Convert-String.ps1 ├── 2.3.2.Convert-String_AbstractExample.ps1 ├── 2.3.3.Convert-String_Hashtable.ps1 ├── 2.3.4.ConvertFrom-String.ps1 ├── 2.3.5.ConvertFrom-String_Template.ps1 ├── 3.0.1.NumersAndTheFormatOperator.ps1 ├── 3.1.1.ByteMultiplicationOperators.ps1 ├── 3.1.2.ByteMultiplicationOperatorsAndFormat.ps1 ├── 3.2.1.PowerOf10Operator.ps1 ├── 3.2.2.Hexadecimal.ps1 ├── 3.2.3.Math_RoundMethod.ps1 ├── 3.2.4.Math_RoundMethodMidpointRounding.ps1 ├── 3.2.5.Math_CeilingAndFloor.ps1 ├── 3.2.6.Math_Abs.ps1 ├── 3.2.7.Math_Pow.ps1 ├── 3.2.8.Math_Sqrt.ps1 ├── 3.2.9.Math_PiAndE.ps1 ├── 4.0.1.Casting.ps1 ├── 4.0.2.Convert_ToInt32_FromBinary.ps1 ├── 4.0.3.Convert_ToInt32_FromHexadecimal.ps1 ├── 5.1.1.CastToDateTime.ps1 ├── 5.1.2.Test-DateTime.ps1 ├── 5.1.3.Test-DateTime_Get-Date.ps1 ├── 5.2.1.DateTime_ParseExact.ps1 ├── 5.2.2.DateTime_ParseExact_MultipleFormats.ps1 ├── 5.2.3.DateTime_TryParseExact.ps1 ├── 5.3.1.Get-Date_And_New-TImeSpan.ps1 ├── 5.3.2.Get-Date_StartOfDay.ps1 ├── 5.3.3.Get-Date_AddDays.ps1 ├── 5.3.4.Get-Date_Add_Other.ps1 ├── 5.3.5.Get-Date_ToUniversalTime.ps1 ├── 5.3.6.Get-Date_Kind.ps1 ├── 5.3.7.Get-Date_UtcKind.ps1 ├── 5.4.1.Get-Date_Format_And_ToString.ps1 ├── 5.4.2.Get-Date_MethodChaining.ps1 ├── 5.4.3.Get-Date_StoringDates.ps1 ├── 5.5.1.ComparingDates.ps1 ├── 5.5.2.ComparingDates_RightHandSideCasting.ps1 └── 5.5.3.ComparingDates_RightHandSideCasting_USFormat.ps1 ├── Chapter09 ├── 1.1.1.FailingRegex.ps1 ├── 1.2.1.SpecialCharacters.ps1 ├── 1.2.2.matches.ps1 ├── 1.2.3.matches_NotCleared.ps1 ├── 1.3.1.AnyCharacter.ps1 ├── 1.3.2.AnyCharacter_NoAnchors.ps1 ├── 1.4.1.Repetition_ZeroOrMore.ps1 ├── 1.4.2.Repetition_ZeroOrMore_Zero.ps1 ├── 1.4.3.Repetition_OneOrMore.ps1 ├── 1.4.4.RepetitionAndPeriod.ps1 ├── 1.4.5.FailureWithoutPrecedingCharacter.ps1 ├── 1.5.1.EscapeCharacter.ps1 ├── 1.5.2.EscapingTheEscapeCharacter.ps1 ├── 1.5.3.EscapingTheEscapeCharacter_WithReplace.ps1 ├── 1.5.4.ValidButInvalid.ps1 ├── 1.5.5.LiteralPeriod.ps1 ├── 1.5.6.RemoveAllBeforeCharacter.ps1 ├── 1.5.7.RemoveAllAfterCharacter.ps1 ├── 1.6.1.OptionalCharacters.ps1 ├── 2.1.0.StartOfString.ps1 ├── 2.1.1.EndOfString.ps1 ├── 2.1.2.ReplaceTooMuch.ps1 ├── 2.1.3.WordBoundary.ps1 ├── 3.1.1.GreedyQuanifier.ps1 ├── 3.1.2.LazyQuanifier.ps1 ├── 3.1.3.GreedyQuantifierAndHtml.ps1 ├── 3.1.4.GreedyQuantifierAndHtml_CharacterClass.ps1 ├── 3.1.5.LazyQuantifierAndHtml.ps1 ├── 4.1.1.CharacterClasses.ps1 ├── 4.1.10.Range_LIteralHyphen_Escaped.ps1 ├── 4.1.2.Range.ps1 ├── 4.1.3.Range_IsASCII.ps1 ├── 4.1.4.Range_HexadecimalNumber.ps1 ├── 4.1.5.Range_HexadecimalNumber_CaseSensitive.ps1 ├── 4.1.6.Range_SimpleIPAddress.ps1 ├── 4.1.7.Range_VersionString.ps1 ├── 4.1.8.Range_LIteralHyphen.ps1 ├── 4.1.9.Range_LIteralHyphen_Alternative.ps1 ├── 4.2.1.NegatedCharacterClass.ps1 ├── 4.3.1.ClassSubtraction_Start.ps1 ├── 4.3.2.ClassSubtraction_UsingSpecificRanges.ps1 ├── 4.3.3.ClassSubtraction_UsingSubtraction.ps1 ├── 5.1.1.Alternation.ps1 ├── 5.1.2.Alternation_Example.ps1 ├── 5.1.3.Alternation_WIthAnchors.ps1 ├── 5.1.4.Alternation_WIthAnchors_AndGroup.ps1 ├── 6.1.1.Repetition_Start.ps1 ├── 6.1.2.Repetition_Groups.ps1 ├── 6.1.3.Repetition_ZeroOrMore.ps1 ├── 6.1.4.Repetition_ZeroOrMore_Versions.ps1 ├── 6.1.5.Alternation_LineBreak.ps1 ├── 6.1.6.Alternation_WordList.ps1 ├── 7.1.1.CaptureGroups.ps1 ├── 7.1.2.CaptureGroups_Nested.ps1 ├── 7.1.3.CaptureGroups_Tokens.ps1 ├── 7.2.1.CaptureGroups_Named.ps1 ├── 7.2.2.CaptureGroups_Named_PSCustomObject.ps1 ├── 7.2.3.CaptureGroups_Named_CastToPSCustomObject.ps1 ├── 7.3.1.NonCapturingGroups_Start.ps1 ├── 7.3.2.NonCapturingGroups_RemovedGroup.ps1 ├── 7.3.3.NonCapturingGroup_Replace.ps1 ├── 8.1.1.MatchMACAddress.ps1 ├── 8.2.1.MatchIPAddress.ps1 ├── 8.2.2.UseIPAddressTryParse.ps1 ├── 8.3.1.netstat_output.ps1 ├── 8.3.2.netstat_MatchTcp.ps1 ├── 8.3.3.netstat_MatchTcpAndUdp.ps1 ├── 8.3.4.netstat_MatchTcpAndUdp_Reordered.ps1 ├── 8.4.1.FormattingCertificates.ps1 └── 8.4.2.FormattingCertificates_Regex.ps1 ├── Chapter10 ├── 1.1.1_Set-Location.ps1 ├── 1.2.1_Get-Item.ps1 ├── 1.2.2_Get-Item_Error.ps1 ├── 1.2.3_Get-Item_Force.ps1 ├── 1.3.1_New-PSDrive.ps1 ├── 2.1.1_Test-Path.ps1 ├── 2.1.2_Test-Path_PathType.ps1 ├── 2.1.3_Test-Path_If.ps1 ├── 2.2.1_New-Item.ps1 ├── 2.2.2_New-Item_ItemType.ps1 ├── 2.2.3_Remove-Item.ps1 ├── 2.3.1_Invoke-Item.ps1 ├── 3.1.1_Set-ItemProperty.ps1 ├── 3.1.2_Get-Item_SetProperty.ps1 ├── 3.2.1_FileAttributes.ps1 ├── 3.2.2_FileAttribute_eq.ps1 ├── 3.2.3_FileAttribute_replace.ps1 ├── 3.2.4_FileAttributes_bxor.ps1 ├── 3.2.5_FileAttribute_bor.ps1 ├── 3.2.6_FileAttributes_assign.ps1 ├── 3.2.7_FileAttribute_AsString.ps1 ├── 3.2.8_FileAttributes_AsString_Explain.ps1 ├── 4.1.1_Get-ItemProperty.ps1 ├── 4.1.2_Set-ItemProperty.ps1 ├── 4.1.3_Remove-ItemProperty.ps1 ├── 4.1.4_New-ItemProperty.ps1 ├── 5.1.1_Setup.ps1 ├── 5.10.1_GenericAccessRights.ps1 ├── 5.10.2_ConvertGenericAccessRights.ps1 ├── 5.2.1_Get-Acl_Owner.ps1 ├── 5.2.2_Set-Acl_Owner.ps1 ├── 5.3.1_Get-Acl_Audit.ps1 ├── 5.4.1_Set-Acl_Protection_Enable.ps1 ├── 5.4.2_Set-Acl_Protection_Disable.ps1 ├── 5.4.3_Get-Acl.ps1 ├── 5.4.4_Set-Acl_Protection_Discard.ps1 ├── 5.4.5_Get-Acl_Error.ps1 ├── 5.4.6_Set-Acl_Fix.ps1 ├── 5.6.1_Set-Acl_Setup_1.ps1 ├── 5.6.2_Set-Acl_Setup_2.ps1 ├── 5.6.3_Get-Acl.ps1 ├── 5.6.4_RemoveAccessRuleSpecific.ps1 ├── 5.7.1_Setup.ps1 ├── 5.7.2_CopyAcl.ps1 ├── 5.7.3_CopyAce.ps1 ├── 5.8.1_RightsEnum.ps1 ├── 5.8.2_ShowRightsEnum.ps1 ├── 5.8.3_FileSystemAccessRule.ps1 ├── 5.8.4_AddAccessRule.ps1 ├── 5.9.1_RegistryAccessRule.ps1 ├── 5.9.2_AddAccessRule.ps1 ├── 6.1.1_Get-PSProvider.ps1 ├── 6.1.2_Start-Transaction.ps1 ├── 6.1.3_Undo-Transaction.ps1 ├── 6.2.4_Complete-Transaction.ps1 ├── 6.3.5_Get-Command_UseTransaction.ps1 ├── 7.1.1_New-FileCatalog.ps1 ├── 7.2.1_Test-FileCatalog.ps1 ├── 7.2.2_Test-FileCatalog.ps1 ├── 7.2.3_Test-FileCatalog_Setup.ps1 ├── 7.2.4_Test-FileCatalog_Added.ps1 ├── 7.2.5_Test-FileCatalog_Removed.ps1 └── 7.2.6_Test-FileCatalog_Modified.ps1 ├── Chapter11 ├── 2.1.1_WQL_SELECT.ps1 ├── 2.1.2_WQL_SELECT_WHERE.ps1 ├── 2.1.3_WQL_Escape_characters.ps1 ├── 2.1.4_WQL_Wildcards.ps1 ├── 2.1.5_Quoting_Outer_Single.ps1 ├── 2.1.6_Quoting_Outer_Double.ps1 ├── 2.1.7_Interpolation_and_sub-expressions.ps1 ├── 2.1.8_Composite_format.ps1 ├── 2.2.1_Associated_classes.ps1 ├── 2.2.2_Wmi_object_path.ps1 ├── 2.2.3_Wmi_accelerator.ps1 ├── 2.2.4_ASSOCIATORS_OF.ps1 ├── 2.2.5_ASSOCIATORS_OF_CimClass.ps1 ├── 2.3.5_ASSOCIATORS_OF_ResultClass.ps1 ├── 2.3.6_ASSOCIATORS_OF_powershell.exe.ps1 ├── 3.1.1_Get-CimInstance.ps1 ├── 3.1.2_Get-CimInstance_Filter.ps1 ├── 3.1.3_Get-CimInstance_Property.ps1 ├── 3.1.4_Get-CimInstance_Query.ps1 ├── 3.2.1_Get-CimClass.ps1 ├── 3.2.2_Get-CimInstance_Namespace.ps1 ├── 3.2.3_Get-CimNamespace.ps1 ├── 3.3.1_ClassMethods.ps1 ├── 3.3.2_ClassMethod_Parameters.ps1 ├── 3.3.3_Invoke-CimMethod.ps1 ├── 3.3.4_Invoke-CimMethod_output.ps1 ├── 3.3.5_Invoke-CimMethod_Terminate.ps1 ├── 3.3.6_Invoke-CimMethod_Terminate_Reason.ps1 ├── 3.5.1_New-CimInstance.ps1 ├── 3.5.2_CimInstance_new.ps1 ├── 3.5.3_New-CimInstance_Example.ps1 ├── 3.6.1_New-CimSession.ps1 ├── 3.6.2_New-CimSession_SessionOption.ps1 ├── 3.7.1_Get-CimAssociatedInstance.ps1 ├── 3.7.2_Get-CimAssociatedInstance_Example.ps1 ├── 4.1.1_Wmi_and_WmiClass.ps1 ├── 4.2.1_Get-WmiObject.ps1 ├── 4.2.2_WmiSearcher.ps1 ├── 4.3.1_Get-WmiObject_Date.ps1 ├── 4.3.2_Get-WmiObject_DateTimeConverter.ps1 ├── 4.4.1_Get-WmiObject_Class.ps1 ├── 4.4.2_Get-WmiObject_Class_Recurse.ps1 ├── 4.4.3_WmiClass.ps1 ├── 4.5.1_InstanceMethods.ps1 ├── 4.6.1_Win32_Share_CreateMethod.ps1 ├── 4.6.2_Win32_Share_CreateMethod_Parameters.ps1 ├── 4.6.3_CreateShare.ps1 ├── 4.7.1_CreateInstance.ps1 ├── 4.8.1_AssociatedClasses.ps1 ├── 5.1.10_Convert_DACL_ACE.ps1 ├── 5.1.11_CreateTrustee.ps1 ├── 5.1.12_CreateACE.ps1 ├── 5.1.13_AddToDACL.ps1 ├── 5.1.14_SetDescriptor.ps1 ├── 5.1.1_CreateShare.ps1 ├── 5.1.2_CreateShare_MethodParameters.ps1 ├── 5.1.3_ShareSecurity.ps1 ├── 5.1.4_Descriptor.ps1 ├── 5.1.5_aclObject.ps1 ├── 5.1.6_DACL.ps1 ├── 5.1.7_DACL_Trustee.ps1 ├── 5.1.8_AceFlags.ps1 ├── 5.1.9_FileSystemRights.ps1 ├── 5.2.1_WmiPermissions.ps1 ├── 5.2.2_GetSecurityDescriptor.ps1 ├── 5.3.1_SDDL.ps1 ├── 5.3.2_SetFromSDDL.ps1 ├── 5.3.3_SecurityDescriptorHelper.ps1 ├── 5.3.4_SDDLtoBackup.ps1 ├── 5.3.5_ViewSDDL.ps1 ├── 5.3.6_ImportSDDL.ps1 └── 5.3.7_ViewDescriptor.ps1 ├── Chapter12 ├── 1.1.1_ConvertTo-Html.ps1 ├── 1.2.1_ConvertTo-Html_CreateReport.ps1 ├── 1.3.1_ConvertTo-Html_CSS.ps1 ├── 1.3.2_ConvertTo-Html_Injecting_CSS.ps1 ├── 1.4.1_System.Web.ps1 ├── 1.4.2_System.Web_HtmlEncode.ps1 ├── 1.4.3_System.Web_HtmlDecode.ps1 ├── 3.1.1_ExampleXml.ps1 ├── 3.1.2_PropertyExpansion.ps1 ├── 3.10.1_RemoveChild.ps1 ├── 3.10.2_RemoveAttribute.ps1 ├── 3.11.1_ISEHelp.ps1 ├── 3.11.2_SchemaValidation.ps1 ├── 3.2.1_ExampleXml.ps1 ├── 3.2.2_Select-Xml.ps1 ├── 3.2.3_SelectNodes.ps1 ├── 3.2.4_Select-Xml_FromFile.ps1 ├── 3.3.1_Namespaces.ps1 ├── 3.4.1_Namespaces_SelectNodes.ps1 ├── 3.5.1_Namespaces_SelectNodes.ps1 ├── 3.6.1_XmlWriter.ps1 ├── 3.6.2_XmlWriter_Settings.ps1 ├── 3.7.1_ModifyingXml.ps1 ├── 3.7.2_ExampleXml.ps1 ├── 3.7.3_SelectSingleNode_Set.ps1 ├── 3.7.4_SelectSingleNode_Attribute.ps1 ├── 3.8.1_NewElement.ps1 ├── 3.9.1_ExampleXml.ps1 ├── 3.9.2_ImportNode.ps1 ├── 3.9.3_OuterXml.ps1 ├── 4.1.1_Add-Type.ps1 ├── 4.1.2_using_assembly.ps1 ├── 4.2.1_ExampleXml.ps1 ├── 4.2.2_Load.ps1 ├── 4.3.1_SelectingNodes.ps1 ├── 4.3.2_UsingXPath.ps1 ├── 4.4.1_CreateDocument.ps1 ├── 4.4.2_ToString.ps1 ├── 4.4.3_Save.ps1 ├── 4.4.4_Get-Content.ps1 ├── 4.5.1_XNamespace.ps1 ├── 4.5.2_XNamespace_Shorthand.ps1 ├── 4.5.3_Select_with_namespace.ps1 ├── 4.6.1_Modify_Element.ps1 ├── 4.6.2_Modify_Attribute.ps1 ├── 4.6.3_Modify_Attribute_Error.ps1 ├── 4.7.1_Add_element.ps1 ├── 4.8.1_Remove_nodes.ps1 ├── 4.9.1_SchemaValidation.ps1 ├── 5.1.1_ConvertTo-Json.ps1 ├── 5.1.2_ConvertTo-Json_FromHashtable.ps1 ├── 5.2.1_ConvertFrom-Json.ps1 ├── 5.2.2_ConvertFrom-Json_DataTypes.ps1 ├── 5.2.3_ConvertFrom-Json_DataTypes_GetType.ps1 ├── 5.3.1_JSON_and_Get-Date.ps1 ├── 5.3.2_Serializer_mismatch.ps1 ├── 5.3.4_DateTime_type.ps1 └── 5.3.4_Remove-TypeData.ps1 ├── Chapter13 ├── 1.1.1_Invoke-WebRequest.ps1 ├── 1.2.1_Invoke-WebRequest_Headers.ps1 ├── 1.3.1_Invoke-WebRequest_InvalidCertificate.ps1 ├── 1.3.2_Invoke-WebRequest_InvalidCertificate_PSCore.ps1 ├── 1.4.1_CertificatePolicy.ps1 ├── 1.4.2_Invoke-WebRequest_CertificatePolicy.ps1 ├── 1.5.1_WebClient_ServicePointManager.ps1 ├── 1.5.2_TestSslConnection.ps1 ├── 1.5.3_Certificate.ps1 ├── 1.5.4_Chain.ps1 ├── 1.5.5_ChainStatus.ps1 ├── 1.6.2_SecurityProtocol.ps1 ├── 1.9.9_OAUTH_token_header.ps1 ├── 2.1.1_Invoke-RestMethod.ps1 ├── 2.1.1_ParseQueryString.ps1 ├── 2.1.2_Invoke-RestMethod_UsingBody.ps1 ├── 2.1.3_Invoke-RestMethod_Response.ps1 ├── 2.1.4_Invoke-RestMethod_CaseSensitive.ps1 ├── 2.2.1_Invoke-RestMethod_ResponseHeaderVariable.ps1 ├── 2.2.2_HeaderValue.ps1 ├── 2.2.3_Invoke-RestMethod_FollowRelLink.ps1 ├── 2.2.4_Invoke-WebRequest_FollowRelLink.ps1 ├── 2.3.10_UseToken.ps1 ├── 2.3.1_BasicAuthentication.ps1 ├── 2.3.2_BasicAuthentication_PSCore.ps1 ├── 2.3.3_BasicAuthentication_2Factor_Error.ps1 ├── 2.3.4_OAUTH_Secrets.ps1 ├── 2.3.5_GetAuthorizationCode.ps1 ├── 2.3.6_WebViewWPFControl.ps1 ├── 2.3.7_BrowserControl.ps1 ├── 2.3.8_GetAccessToken.ps1 ├── 3.1.1_New-WebServiceProxy_Type.ps1 ├── 3.1.2_New-WebServiceProxy.ps1 ├── 3.2.1_Discover_methods.ps1 ├── 3.2.3_Invoke_Methods.ps1 ├── 3.2.4_SimpleArguments.ps1 ├── 3.2.5_Enum.ps1 ├── 3.2.6_GetEnumValues.ps1 ├── 3.2.7_InvokeMethodRequiringEnum.ps1 ├── 3.2.8_ExplicitEnumValue.ps1 ├── 3.3.1_ComplexArguments.ps1 ├── 3.3.2_CreateObject.ps1 ├── 3.3.3_ComparisonOperator.ps1 ├── 3.3.4_MethodArguments.ps1 ├── 3.4.1_OverlappingServices.ps1 ├── 3.4.2_BadTypeLookup.ps1 ├── 3.4.3_FindingTheType.ps1 └── 3.4.4_NamespaceProperty.ps1 ├── Chapter14 ├── 1.1.1_Disable-Remoting.ps1 ├── 1.2.1_Get-WSManInstance.ps1 ├── 1.3.1_Get-WSManInstance.ps1 ├── 1.3.2_Restart_winrm.ps1 ├── 1.4.10_UpdateCertificate.ps1 ├── 1.4.1_New-SelfSignedCertificate.ps1 ├── 1.4.2_CreateSSLListener.ps1 ├── 1.4.3_OpenFirewall.ps1 ├── 1.4.4_Set-WSManQuickConfig.ps1 ├── 1.4.5_ListListeners.ps1 ├── 1.4.6_ListListenersProperties.ps1 ├── 1.4.7_UsingSSL.ps1 ├── 1.4.8_SkipCACheck.ps1 ├── 1.4.9_Test-WSMan.ps1 ├── 1.5.1_Get-PSSessionConfiguration.ps1 ├── 1.5.2_Set-PSSessionConfiguration_ShowSecurityDescriptorUI.ps1 ├── 1.5.3_ReadPermissions.ps1 ├── 1.5.4_ReadAndWrite.ps1 ├── 1.5.5_Get-PSSessionAccess.ps1 ├── 1.5.6_SIDTranslate.ps1 ├── 1.5.7_AddAccess.ps1 ├── 1.5.8_SetAcl.ps1 ├── 1.6.1_GetLocalAccountTokenFilterPolicy.ps1 ├── 1.6.2_SetLocalAccountTokenFilterPolicy.ps1 ├── 1.7.1_GetTrustedHosts.ps1 ├── 1.7.2_Add-TrustedHost.ps1 ├── 2.1.1_New-PSSession.ps1 ├── 2.2.1_Get-PSSession.ps1 ├── 2.2.2_SessionsAreGlobal.ps1 ├── 2.2.3_SessionsAreGlobal_Get-PSSession.ps1 ├── 2.3.10_Reconnect.ps1 ├── 2.3.11_SessionState.ps1 ├── 2.3.12_UsingScope.ps1 ├── 2.3.1_Invoke-Command.ps1 ├── 2.3.2_Invoke-Command_MultipleComputers.ps1 ├── 2.3.3_RemotingAndLocalFunctions.ps1 ├── 2.3.4_ArgumentList_Splatting.ps1 ├── 2.3.5_AsJob.ps1 ├── 2.3.6_AsJob_SessionAvailability.ps1 ├── 2.3.7_InDisconnectedSession.ps1 ├── 2.3.8_InDisconnectedSession_ConnectAndReceive.ps1 ├── 2.3.9_CreateAndDisconnect.ps1 ├── 2.4.1_Enter-PSSession.ps1 ├── 2.4.2_Enter-PSSession_Session.ps1 ├── 2.5.1_Import-PSSession.ps1 ├── 2.6.1_Export-PSSession.ps1 ├── 2.6.2_Import-Module_ExportedSession.ps1 ├── 2.7.1_Copy-Item_FromSession.ps1 ├── 2.7.2_Copy-Item_ToSession.ps1 ├── 3.1.1_ListShells.ps1 ├── 3.1.2_chsh.ps1 ├── 3.1.3_yum.ps1 ├── 3.1.4_firewall-cmd.ps1 ├── 3.1.5_Enter-PSSession.ps1 ├── 4.1.1_InstallOpenSSH.ps1 ├── 4.1.2_ReconfigureAndRestartSSHD.ps1 ├── 4.1.3_GetPublicKey.ps1 ├── 4.1.4_AddToAuthorizedKeys.ps1 ├── 4.1.5_Enter-PSSession_SSHTransport.ps1 ├── 4.2.1_Enter-PSSession_WSMan.ps1 ├── 4.2.2_InstallSSHD.ps1 ├── 4.2.3_ReconfigureAndRestartSSHD.ps1 ├── 4.2.4_Enter-PSSession_PasswordInteractive.ps1 ├── 4.2.5_GetPublicKey.ps1 ├── 4.2.6_AddToAuthorizedKeys.ps1 ├── 4.2.7_Enter-PSSession_SSHTransport.ps1 ├── 5.1.1_New-PSSession_CredSSP.ps1 ├── 5.1.2_Enable-WSManCredSSP.ps1 ├── 5.1.3_Enable-WSManCredSSP_Server.ps1 ├── 5.1.4_Disable-WSManCredSSP_Client.ps1 ├── 5.1.5_Disable-WSManCredSSP_Server.ps1 ├── 5.2.1_PassingCredentials.ps1 ├── 6.1.1_CimSessionCommands.ps1 ├── 6.2.1_New-CimSession_WSMan.ps1 ├── 6.2.2_New-CimSession_DCOM.ps1 ├── 6.2.3_New-CimSession_DCOM_Forced.ps1 ├── 6.2.4_Get-CimSession.ps1 └── 6.3.1_UsingCimSession.ps1 ├── Chapter15 ├── 1.1.1.Start-Job.ps1 ├── 1.1.2.Start-Job_Throttling.ps1 ├── 1.2.1.Receive-Job.ps1 ├── 1.3.1.Wait-Job_Alternative.ps1 ├── 1.3.2.Wait-Job_Drain.ps1 ├── 1.3.3.Wait-Job_Queue_and_Drain.ps1 ├── 2.1.1.Get-Member.ps1 ├── 2.1.2.FileSystemWatcher_Events.ps1 ├── 2.2.1.Register-ObjectEvent.ps1 ├── 2.2.2.Get-Event.ps1 ├── 2.2.3.Get-Event_SourceEventArgs.ps1 ├── 2.2.4.Get-Event_SourceEventArgs_Duplicate.ps1 ├── 2.3.1.Get-EventSubscriber.ps1 ├── 2.3.2.Unregister-Event.ps1 ├── 2.4.1.Register-ObjectEvent_Action.ps1 ├── 2.4.2.Raise_Event.ps1 ├── 2.4.3.Cleanup.ps1 ├── 2.4.4.Register-ObjectEvent_MessageData.ps1 ├── 2.4.5.Raise_Event.ps1 ├── 3.1.1.PowerShellInstance.ps1 ├── 3.1.2.AddCommand.ps1 ├── 3.1.3.AddStatement.ps1 ├── 3.1.4.Equivalent.ps1 ├── 3.1.5.AddScript.ps1 ├── 3.2.1.BeginInvoke.ps1 ├── 3.2.2.InvocationStateInfo.ps1 ├── 3.2.3.IASyncInfo.ps1 ├── 3.2.4.OnCompletion.ps1 ├── 3.2.5.OnCompletion.ps1 ├── 3.2.6.OrphanedRunspace.ps1 ├── 3.2.7.OrphanedRunspace_InProgress.ps1 ├── 3.2.8.Stop.ps1 ├── 3.3.1.EndInvoke.ps1 ├── 3.3.2.BeginInvoke_PSDataCollection.ps1 ├── 3.3.3.BeginInvoke_InputPipeline.ps1 ├── 3.3.4.BeginInvoke_InputPipeline_Script.ps1 ├── 3.4.1.MultipleInstances.ps1 ├── 3.4.2.MultipleInstances_State.ps1 ├── 3.4.3.Waiting.ps1 ├── 3.5.1.CreateRunspacePool.ps1 ├── 3.5.2.RunspacePoolUsage.ps1 ├── 3.5.3.RunspacePool_Progress.ps1 ├── 3.5.4.RunspacePool_CleaningUp.ps1 ├── 3.5.5.RunspacePool_GC_Collect.ps1 ├── 3.6.1.InitialSessionState.ps1 ├── 3.6.10.SessionStateFunctionEntry.ps1 ├── 3.6.11.SessionStateFunctionEntry_FromFunction.ps1 ├── 3.6.2.InitialSessionState_CreateDefault.ps1 ├── 3.6.3.InitialSessionState_CreateDefault2.ps1 ├── 3.6.4.ImportPSModule.ps1 ├── 3.6.5.ImportPSModule_Multiple.ps1 ├── 3.6.6.ImportPSSnapIn.ps1 ├── 3.6.7.SessionStateVariableEntry.ps1 ├── 3.6.8.SessionStateVariableEntry_ScopeOptions.ps1 ├── 3.6.9.SessionStateVariableEntry_FromVariable.ps1 ├── 3.7.1.InitialSessionState_and_RunspacePool.ps1 ├── 3.7.2.SetMaxRunspaces.ps1 ├── 3.8.1.SynchronizedHashtable.ps1 ├── 3.8.2.SynchronizedHashtable_Usage.ps1 ├── 3.8.3.SynchronizedArrayList.ps1 └── 3.8.4.ConcurrentStack.ps1 ├── Chapter16 ├── 1.1.1_Requires.ps1 ├── 1.1.2_about_Requires.ps1 ├── 1.2.1_Using_recap.ps1 ├── 1.3.1_Nested_Functions.ps1 ├── 1.4.1_about_comment_based_help.ps1 ├── 1.4.2_CBH_script.ps1 ├── 1.4.3_CBH_function.ps1 ├── 1.4.4_CBH_parameter.ps1 ├── 1.4.5_CBH_parameter_inline.ps1 ├── 1.4.6_Get-Help_Parameter.ps1 ├── 1.4.7_CBH_example.ps1 ├── 1.4.8_CBH_example_code_parser.ps1 ├── 1.5.1_line_break_on_pipe.ps1 ├── 1.5.2_short_pipeline.ps1 ├── 1.5.3_line_break_on_logic_operator.ps1 ├── 1.5.4_line_break_on property_dereference_operator.ps1 ├── 1.5.5_format_and_array_operator.ps1 ├── 1.5.6_replace_and_array_operator.ps1 ├── 1.5.7_select_and_array_operator.ps1 ├── 2.1.1_Function_vs_Filter.ps1 ├── 2.1.2_Show-Pipeline_begin.ps1 ├── 2.2.1_Show-Pipeline_process.ps1 ├── 2.2.2_Show-Pipeline_running.ps1 ├── 2.2.3_Show-Pipeline_extended_running.ps1 ├── 2.3.1_Show-Pipeline_end.ps1 ├── 2.3.2_Show-Pipeline_running.ps1 ├── 2.3.3_Measure-Item.ps1 ├── 2.4.1_Invoke-Return.ps1 ├── 2.4.2_Invoke-Return_running.ps1 ├── 2.5.1_StringBuilder.ps1 ├── 2.5.2_Demo_function.ps1 ├── 2.5.3_Unintended_output.ps1 ├── 2.5.4_Out-Null.ps1 ├── 2.5.5_Assign_to_null.ps1 ├── 2.5.6_Redirect_to_null.ps1 ├── 2.5.7_Cast_to_Void.ps1 ├── 2.5.8_Cast_to_Void_Parentheses.ps1 ├── 3.1.1_param.ps1 ├── 3.2.1_param_type.ps1 ├── 3.2.2_param_nullable.ps1 ├── 3.2.3_Test-Nullable.ps1 ├── 3.3.1_Default_value.ps1 ├── 3.3.2_Default_value_Command_output.ps1 ├── 3.3.4_Default_value_throw.ps1 ├── 3.4.1_Cross_referencing.ps1 ├── 3.5.1_CmdletBinding_empty_param.ps1 ├── 3.5.2_about_CommonParameters.ps1 ├── 3.5.3_Show-Verbose.ps1 ├── 3.5.4_CmdletBinding.ps1 ├── 3.5.5_CmdletBinding_positional_binding.ps1 ├── 3.5.6_CmdletBinding_positional_binding_failure.ps1 ├── 4.1.1_ShouldProcess_TargetObject.ps1 ├── 4.1.2_WhatIf_running.ps1 ├── 4.1.3_ShouldProcess_TargetObject_and_Action.ps1 ├── 4.1.4_WhatIf_running.ps1 ├── 4.1.5_ShouldProcess_All.ps1 ├── 4.1.6_Confirm_running.ps1 ├── 4.1.7_ShouldProcess_loop.ps1 ├── 4.1.8_ShouldProcess_ConfirmImpact.ps1 ├── 4.2.1_ShouldContinue.ps1 ├── 4.2.2_ShouldContinue_running.ps1 ├── 4.2.3_ShouldContinue_yesToAll_noToAll.ps1 ├── 4.2.4_ShouldContinue_running.ps1 └── 4.2.5_ShouldContinue_Force.ps1 ├── Chapter17 ├── 1.1.1.ParameterAttribute.ps1 ├── 1.1.2.ParameterAttributeAndCmdletBinding.ps1 ├── 1.1.3.ParameterAttributeAddsCmdletBInding.ps1 ├── 1.1.4.ParameterAttribute_BooleanShorthand.ps1 ├── 1.2.1.PositionalBinding.ps1 ├── 1.2.2.PositionalBinding.ps1 ├── 1.2.3.PositionalBinding_EffectivelyDisabled_Function.ps1 ├── 1.2.4.PositionalBinding_EffectivelyDisabled_FalsePositive.ps1 ├── 1.2.5.PositionalBinding_EffectivelyDisabled_BindingError.ps1 ├── 1.3.1.DontShow.ps1 ├── 1.4.1.ValueFromRemainingArguments_BasicFunction.ps1 ├── 1.4.2.ValueFromRemainingArguments_UnboundArguments.ps1 ├── 1.4.3.ValueFromRemainingArguments_AdvancedFunction.ps1 ├── 1.5.1.HelpMessage.ps1 ├── 2.1.1.PSTypeNameAttribute.ps1 ├── 2.1.2.PSTypeNameAttribute_Get-Member.ps1 ├── 2.1.3.PSTypeNameAttribute_AddAndInsert.ps1 ├── 2.1.4.PSTypeNameAttribute_Add-Member.ps1 ├── 2.1.5.PSTypeNameAttribute_Validation.ps1 ├── 2.1.6.PSTypeNameAttribute_Exploration.ps1 ├── 2.1.7.PSTypeNameAttribute_WMITypeNames.ps1 ├── 2.2.1.Exploration.ps1 ├── 2.2.10.ValidatePattern_Options.ps1 ├── 2.2.11.ValidatePattern_Options_Multiple.ps1 ├── 2.2.12.ValidatePattern_Options_CaseSensitive.ps1 ├── 2.2.13.ValidatePattern_WindowsPowerShell_ErrorMessage.ps1 ├── 2.2.14.ValidatePattern_PowerShellCore_ErrorMessage.ps1 ├── 2.2.15.ValidateRange.ps1 ├── 2.2.16.ValidateScript.ps1 ├── 2.2.17.ValidateScript_PowerShellCore_ErrorMessage.ps1 ├── 2.2.18.ValidateScript_WindowsPowerShell_ErrorMessage.ps1 ├── 2.2.19.ValidateSet.ps1 ├── 2.2.2.ValidateNotNull.ps1 ├── 2.2.20.ValidateSet_CaseSensitive.ps1 ├── 2.2.3.ValidateNotNull_AllowsEmpty.ps1 ├── 2.2.4.ValidateNotNull_ErrorOnNull.ps1 ├── 2.2.5.ValidateNotNullOrEmpty.ps1 ├── 2.2.6.ValidateCount.ps1 ├── 2.2.7.ValidateDrive.ps1 ├── 2.2.8.ValidateLength.ps1 ├── 2.2.9.ValidatePattern.ps1 ├── 2.3.1.AllowNull.ps1 ├── 2.3.2.AllowEmptyString.ps1 ├── 2.3.3.AllowEmptyCollection.ps1 ├── 2.3.4.AllowEmptyCollection_Demo.ps1 ├── 2.4.1.PSReference.ps1 ├── 2.4.2.PSReference_ReferenceTypes.ps1 ├── 2.4.3.PSReference_Test-Date.ps1 ├── 2.4.4.PSReference_Test-Date_Usage.ps1 ├── 3.1.1.ValueFromPipeine.ps1 ├── 3.1.10.ValueFromPipeine_MutlipleParams_TypeSelection.ps1 ├── 3.1.11.ValueFromPipeine_PSTypeName.ps1 ├── 3.1.12.ValueFromPipeine_PSTypeName_CreatingTheType.ps1 ├── 3.1.2.ValueFromPipeine_NormalBehaviour.ps1 ├── 3.1.3.ValueFromPipeine_NullInInputPipeline.ps1 ├── 3.1.4.ValueFromPipeine_AllowNull.ps1 ├── 3.1.5.ValueFromPipeine_Where-Object_Filtering.ps1 ├── 3.1.6.ValueFromPipeine_InputObjectType.ps1 ├── 3.1.7.ValueFromPipeine_MutlipleParams.ps1 ├── 3.1.8.ValueFromPipeine_MutlipleParams_Usage.ps1 ├── 3.1.9.ValueFromPipeine_MutlipleParams_Trace-Command.ps1 ├── 3.2.1.ValueFromPipelineByPropertyName.ps1 ├── 3.2.2.ValueFromPipelineByPropertyName_MultipleParams.ps1 ├── 3.2.3.ValueFromPipelineByPropertyName_MultipleParams_Binding.ps1 ├── 3.2.4.ValueFromPipelineByPropertyName_Alias_Defining.ps1 ├── 3.2.5.ValueFromPipelineByPropertyName_Alias_Binding.ps1 ├── 4.1.1.ParameterSets.ps1 ├── 4.1.2.ParameterSets_Resolution.ps1 ├── 4.1.3.DefaultParameterSetName.ps1 ├── 4.1.4.PositionAndParameterSetName.ps1 ├── 4.1.5.Get-ServiceProcess.ps1 ├── 4.1.6.AllParameterSets.ps1 ├── 4.1.7.AllParameterSets_ShowSyntax.ps1 ├── 4.1.8.MultipleParameterSets.ps1 ├── 4.1.9.MultipleParameterSets_Exploration.ps1 ├── 5.1.1.ArgumentCompleters_Body.ps1 ├── 5.2.1.ArgumentCompleterAttribute.ps1 ├── 5.3.1.Register-ArgumentCompleter.ps1 ├── 5.3.2.Register-ArgumentCompleter_Native.ps1 ├── 5.3.3.Get-ArgumentCompleter.ps1 ├── 6.1.1.dynamicparam.ps1 ├── 6.1.2.dynamicparam_SyntaxError.ps1 ├── 6.2.1.RuntimeDefinedParameter.ps1 ├── 6.2.2.RuntimeDefinedParameter_paramEquivalent.ps1 ├── 6.2.3.RuntimeDefinedParameter_MultipleParameterAttribute.ps1 ├── 6.3.1.RuntimeDefinedParameterDictionary.ps1 ├── 6.4.1.UsingDynamicParameters.ps1 ├── 6.4.2.UsingDynamicParameters_Pipeline.ps1 ├── 6.4.3.UsingDynamicParameters_Pipeline_Usage.ps1 └── 6.5.1.ConditionalParameters.ps1 ├── Chapter18 ├── 1.1.1.enum.ps1 ├── 1.1.2.enum_duplicate_values.ps1 ├── 1.2.1.enum_GetEnumUnderlyingType.ps1 ├── 1.2.2.enum_CastToInt.ps1 ├── 1.2.3.enum_NewToPS62.ps1 ├── 1.3.1.enum_no_value.ps1 ├── 1.3.2.enum_sequencing.ps1 ├── 1.3.3.enum_sequencing_skipping_and_restarting.ps1 ├── 1.4.1.enum_vs_ValidateSet.ps1 ├── 1.4.2.enum_cast_to_Boolean.ps1 ├── 1.5.1.enum_flags.ps1 ├── 1.5.2.enum_flags_casting_string.ps1 ├── 1.5.3.enum_flags_casting_int.ps1 ├── 1.5.4.enum_composite_flags.ps1 ├── 1.5.5.enum_composite_flags_resolution.ps1 ├── 1.5.6.enum_composite_flags_deconstructing.ps1 ├── 1.6.1.enum_union.ps1 ├── 1.6.2.enum_union_demo.ps1 ├── 2.1.1.class.ps1 ├── 2.1.2.class_new.ps1 ├── 2.2.1.properties.ps1 ├── 2.2.2.properties_getter_and_setter.ps1 ├── 2.2.3.properties_accessing.ps1 ├── 2.3.1.constructors_default.ps1 ├── 2.3.2.constructors_explicit.ps1 ├── 2.3.3.constructors_overloaded.ps1 ├── 2.4.1.methods.ps1 ├── 2.4.2.overloaded.ps1 ├── 2.5.1.inheritance.ps1 ├── 2.5.2.inherited_members.ps1 ├── 2.5.3.inherited_override.ps1 ├── 2.5.4.inherited_constructors.ps1 ├── 2.5.5.inherited_constructors_base_arguments.ps1 ├── 2.5.6.inherited_constructors_pseudo_chaining.ps1 ├── 2.6.1.hidden.ps1 ├── 2.6.2.hidden_Get-Member.ps1 ├── 2.7.1.static.ps1 ├── 2.7.2.static_invocation.ps1 ├── 3.1.1.DateTimeStringTransformationAttribute.ps1 ├── 3.1.2.DateTimeStringTransformationAttribute_with_method.ps1 ├── 3.1.3.DateTimeStringTransformationAttribute_usage.ps1 ├── 3.1.4.DateTimeStringTransformationAttribute_result.ps1 ├── 4.1.1.ValidateNotNullOrWhitespaceAttribute.ps1 ├── 4.1.2.ValidateNotNullOrWhitespaceAttribute_usage.ps1 ├── 4.2.1.ValidatePrivateIPAddressAttribute.ps1 ├── 4.2.2.ValidatePrivateIPAddressAttribute_usage.ps1 ├── 5.1.1.DscFramework.ps1 ├── 5.1.2.Dsc_ComputerDescription_Bare.ps1 ├── 5.2.1.Dsc_ComputerDescription_Get.ps1 ├── 5.2.2.Dsc_ComputerDescription_Get_Alternative.ps1 ├── 5.3.1.Dsc_ComputerDescription_Set.ps1 ├── 5.4.1.Dsc_ComputerDescription_Test.ps1 ├── 5.5.1.Dsc_ComputerDescription_Complete.ps1 ├── 5.5.2.Dsc_ComputerDescription_ModuleCreation.ps1 ├── 5.5.3.Dsc_ComputerDescription_using_module.ps1 ├── 5.5.4.Dsc_ComputerDescription_Get.ps1 ├── 5.5.5.Dsc_ComputerDescription_Get-DscResource.ps1 └── 5.5.6.Dsc_ComputerDescription_Invoke-DscResource.ps1 ├── Chapter19 ├── 1.1.1.LocalMachine_v1.psm1 ├── 1.1.2.Get-Module_ListAvailable.ps1 ├── 1.2.1.LocalMachine_Export-ModuleMember.psm1 ├── 1.2.2.Export-ModuleMember_wildcards.ps1 ├── 1.3.1.New-ModuleManifest.ps1 ├── 1.3.2.New-ModuleManifest_FailedUpdate.ps1 ├── 1.3.3.Update-Metadata.ps1 ├── 2.1.1.DotSourcing_Generalised.psm1 ├── 2.1.2.DotSourcing_Specific.psm1 ├── 2.2.1.ModuleBuilder.ps1 ├── 2.2.2.ModuleBuilder_InModuleFolder.ps1 ├── 2.2.3.SimpleBuildScript.ps1 ├── 3.1.1.ModuleScope_Pattern.psm1 ├── 3.2.1.ModuleService.psm1 ├── 3.2.2.ModuleService_AccessingVariables.ps1 ├── 3.2.3.ModuleService_InvokePrivateFunction.ps1 ├── 3.2.4.ModuleService_ListingCommands.ps1 ├── 4.2.1.TestOnRemove.psm1 ├── 4.2.2.ShowGlobalVariable.ps1 └── 4.2.3.Remove-Module.ps1 ├── Chapter20 ├── 1.1.1_Ast.ps1 ├── 1.1.2_Ast_ScriptBlock.ps1 ├── 1.1.3_Get-Command_Definition.ps1 ├── 1.1.4_Get-Item.ps1 ├── 1.1.5_Tree_Walk.ps1 ├── 1.1.6_FindAll.ps1 ├── 1.2.1_Tokenize_PS2.ps1 ├── 1.2.2_ParseInput_PS3.ps1 ├── 1.3.1_PSScriptAnalyzer.ps1 ├── 1.3.2_Show-Password.ps1 ├── 1.3.3_Invoke-ScriptAnalyzer.ps1 ├── 1.4.1_New-Message.ps1 ├── 1.4.2_Invoke-ScriptAnalyzer.ps1 ├── 1.4.3_SuppressMessage.ps1 ├── 1.5.1_PSAvoidEmptyNamedBlocks.ps1 ├── 1.5.2_PSAvoidEmptyComments.ps1 ├── 1.5.3_DemoFunction.ps1 ├── 2.1.1_Get-SquareRoot.ps1 ├── 2.1.2_Get-SquareRoot_Tests.ps1 ├── 2.1.3_Get-SquareRoot_Tests_AssertionError_1.ps1 ├── 2.1.4_Get-SquareRoot_Tests_AssertionError_2.ps1 ├── 2.10.10_New-MockObject_MethodCallError.ps1 ├── 2.10.11_DemoFunction.ps1 ├── 2.10.12_New-MockObject_CimSession.ps1 ├── 2.10.13_Set-NetAdapter.ps1 ├── 2.10.14_Get-NetAdapter_Namespace.ps1 ├── 2.10.15_New-CimInstance_WithNamespace.ps1 ├── 2.10.16_New-CimInstance_WithoutNamespace.ps1 ├── 2.10.1_SimpleObject.ps1 ├── 2.10.2_SimpleMethod.ps1 ├── 2.10.3_DemoFunction.ps1 ├── 2.10.4_BasicMocks.ps1 ├── 2.10.5_Describe.ps1 ├── 2.10.6_ReplaceMember.ps1 ├── 2.10.7_BaseMember.ps1 ├── 2.10.8_DemoFunction.ps1 ├── 2.10.9_DemoFunction_Tests.ps1 ├── 2.11.1_DemoFunction.ps1 ├── 2.11.2_Mocks.ps1 ├── 2.11.3_DescriptionBlank.ps1 ├── 2.11.4_DescriptionSet.ps1 ├── 2.11.5_ErrorHandling.ps1 ├── 2.11.6_Combined.ps1 ├── 2.2.1_TestCases.ps1 ├── 2.3.2_IndependentVerification.ps1 ├── 2.3.3_IndependentVerification_Error.ps1 ├── 2.4.1_ShouldThrow.ps1 ├── 2.4.2_ShouldThrowMessage.ps1 ├── 2.4.3_ShouldThrowExceptionType.ps1 ├── 2.4.4_ShouldThrowErrorId.ps1 ├── 2.4.5_ShouldThrowNonTerminating_ErrorVariable.ps1 ├── 2.4.6_ShouldThrowNonTerminating_ErrorAction.ps1 ├── 2.6.1_DemoFunction.ps1 ├── 2.6.2_BeforeAll.ps1 ├── 2.6.3_AfterAll.ps1 ├── 2.6.4_BeforeEach.ps1 ├── 2.6.5_It.ps1 ├── 2.6.6_All.ps1 ├── 2.7.1_TestDrive_BeforeAll.ps1 ├── 2.7.2_TestDrive_AfterAll.ps1 ├── 2.8.1_Mock.ps1 ├── 2.8.2_Mock_MockWith.ps1 ├── 2.9.10_DemoFunction.ps1 ├── 2.9.11_NonLocalCommand.ps1 ├── 2.9.12_GetParamBlock.ps1 ├── 2.9.3_Mock_MockWith_Parameter.ps1 ├── 2.9.4_DemoFunction.ps1 ├── 2.9.5_Assert-MockCalled.ps1 ├── 2.9.6_Assert-MockCalled_Times_0.ps1 ├── 2.9.7_Assert-MockCalled_Times_Exactly.ps1 ├── 2.9.8_ParameterFilter.ps1 └── 2.9.9_ParameterFilter_Usage.ps1 ├── Chapter21 ├── 1.1.1_TerminatingError.ps1 ├── 1.2.1_TerminatingError.ps1 ├── 2.1.1_ErrorAction_SilentlyContinue.ps1 ├── 2.1.2_ErrorVariable.ps1 ├── 2.1.3_ErrorAction_Stop.ps1 ├── 3.1.1_ErrorRecord.ps1 ├── 3.1.2_ScriptStackTrace.ps1 ├── 3.1.3_StackTrace.ps1 ├── 3.1.4_TargetObject.ps1 ├── 3.1.5_UsingTargetObject.ps1 ├── 3.2.1_Write-Error_Message.ps1 ├── 3.2.2_Write-Error_CategoryAndErrorId.ps1 ├── 3.2.3_Write-Error_Loop.ps1 ├── 3.3.3_Write-Error_ErrorActionStop.ps1 ├── 3.4.1_throw.ps1 ├── 3.5.1_throw_ExceptionType.ps1 ├── 3.5.2_throw_ArgumentException.ps1 ├── 3.5.3_throw_ErrorRecord.ps1 ├── 3.5.4_ThrowTerminatingError.ps1 ├── 3.6.1_BuiltInErrorVariable.ps1 ├── 3.6.2_BuiltInErrorVariable_Index.ps1 ├── 3.6.3_NamedErrorVariable.ps1 ├── 3.6.4_NamedErrorVariable_Enumerate.ps1 ├── 3.6.5_BuiltInErrorVariable_Duplication.ps1 ├── 4.1.1_TryCatch.ps1 ├── 4.1.2_TryCatch_UnderscoreAndPSItem.ps1 ├── 4.1.3_TryCatch_ExceptionType.ps1 ├── 4.1.4_TryCatch_MultipleExceptionTypes.ps1 ├── 4.1.5_TryCatch_MultipleExceptionTypesWithCatchAll.ps1 ├── 4.1.6_Finally.ps1 ├── 4.1.7_Finally_Ordering.ps1 ├── 4.2.1_Re-throw.ps1 ├── 4.2.2_Re-throw_ThrowTerminatingError.ps1 ├── 4.2.3_Re-throw_ErrorVariable.ps1 ├── 4.2.4_Re-throw_InnerException.ps1 ├── 4.2.5_Catch_InnerException_Failure.ps1 ├── 4.2.6_Catch_InnerException_MethodInvocationException.ps1 ├── 4.2.7_Catch_InnerException_ArgumentOutOfRangeException.ps1 ├── 4.2.8_Catch_InnerException_InnerException.ps1 ├── 4.2.9_Catch_InnerException_GetBaseException.ps1 ├── 5.1.1_Throw_ErrorAction_Continue.ps1 ├── 5.1.2_ThrowTerminatingError_ErrorAction_Continue.ps1 ├── 5.1.3_Cmdlet_Exceptions.ps1 ├── 5.1.4_Method_Exceptions.ps1 ├── 5.2.1_DemoFunction.ps1 ├── 5.2.2_WithErrorActionDefault.ps1 ├── 5.2.3_WithErrorActionSilentlyContinue.ps1 ├── 5.2.4_WithTryCatch.ps1 ├── 5.2.5_WithTryCatch_Throw.ps1 ├── 5.2.6_WithTryCatch_ThrowTerminatingError.ps1 ├── 5.2.7_WithTryCatch_NoCmdletBinding.ps1 ├── 5.2.8_WithTryCatch_Write-Error.ps1 ├── 5.3.1_Connect-Server.ps1 ├── 5.3.2_Get-ManagementObject.ps1 ├── 5.3.3_Set-ManagementObject.ps1 ├── 5.3.4_NestedTryCatch.ps1 ├── 5.4.1_ErrorAction_Stop.ps1 ├── 5.4.2_ErrorAction_Continue.ps1 ├── 5.5.1_Trap.ps1 ├── 5.5.2_Trap_Terminating.ps1 ├── 5.5.3_Trap_NonTerminating.ps1 └── 5.5.4_Trap_Scope.ps1 ├── LICENSE └── README.md /Chapter01/4.1.1_Get-Help.ps1: -------------------------------------------------------------------------------- 1 | Get-Help Out-Null -------------------------------------------------------------------------------- /Chapter01/4.1.2_UpdatableHelp.ps1: -------------------------------------------------------------------------------- 1 | Get-Help about_Updatable_Help -------------------------------------------------------------------------------- /Chapter01/4.2.10_Get-Help_Detailed.ps1: -------------------------------------------------------------------------------- 1 | Get-Help Get-Process -Detailed -------------------------------------------------------------------------------- /Chapter01/4.2.11_Get-Help_Full.ps1: -------------------------------------------------------------------------------- 1 | Get-Help Get-Process –Full -------------------------------------------------------------------------------- /Chapter01/4.2.1_Get-Help.ps1: -------------------------------------------------------------------------------- 1 | Get-Help -------------------------------------------------------------------------------- /Chapter01/4.2.2_Get-Help_more.ps1: -------------------------------------------------------------------------------- 1 | Get-Help default | more -------------------------------------------------------------------------------- /Chapter01/4.2.3_Get-Help_ShowWindow.ps1: -------------------------------------------------------------------------------- 1 | Get-Help default -ShowWindow -------------------------------------------------------------------------------- /Chapter01/4.2.4_Get-Help_All.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/4.2.4_Get-Help_All.ps1 -------------------------------------------------------------------------------- /Chapter01/4.2.5_Get-Help_Example.ps1: -------------------------------------------------------------------------------- 1 | Get-Help Get-Variable -------------------------------------------------------------------------------- /Chapter01/4.2.6_Get-Help_Online.ps1: -------------------------------------------------------------------------------- 1 | Get-Help Get-Command -Online -------------------------------------------------------------------------------- /Chapter01/4.2.8_Get-Help_Examples.ps1: -------------------------------------------------------------------------------- 1 | Get-Help Get-Process -Examples -------------------------------------------------------------------------------- /Chapter01/4.2.9_Get-Help_Parameter.ps1: -------------------------------------------------------------------------------- 1 | Get-Help Import-Csv -Parameter Path -------------------------------------------------------------------------------- /Chapter01/4.3.1_Save-Help.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/4.3.1_Save-Help.ps1 -------------------------------------------------------------------------------- /Chapter01/4.3.2_Save-Help_All.ps1: -------------------------------------------------------------------------------- 1 | Save-Help -DestinationPath C:\PSHelp -------------------------------------------------------------------------------- /Chapter01/4.4.1_Update-Help.ps1: -------------------------------------------------------------------------------- 1 | Update-Help -------------------------------------------------------------------------------- /Chapter01/4.4.2_Update-Help_SingleModule.ps1: -------------------------------------------------------------------------------- 1 | Update-Help -Module DnsClient -Verbose -------------------------------------------------------------------------------- /Chapter01/4.4.3_Update-Help_ImportHelp.ps1: -------------------------------------------------------------------------------- 1 | Update-Help -SourcePath C:\temp -------------------------------------------------------------------------------- /Chapter01/4.4.5_Update-Help_NamedCulture.ps1: -------------------------------------------------------------------------------- 1 | Update-Help -SourcePath C:\Temp -Module DnsClient -UICulture en-US 2 | -------------------------------------------------------------------------------- /Chapter01/4.5.1_Get-Help_About.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/4.5.1_Get-Help_About.ps1 -------------------------------------------------------------------------------- /Chapter01/5.1.1_Get-Verb.ps1: -------------------------------------------------------------------------------- 1 | Get-Verb -------------------------------------------------------------------------------- /Chapter01/5.3.1_Get-Command.ps1: -------------------------------------------------------------------------------- 1 | Get-Command Get-*Firewall* -Module NetSecurity -------------------------------------------------------------------------------- /Chapter01/5.3.2_Get-Command_Wildcards.ps1: -------------------------------------------------------------------------------- 1 | Get-Command Get-*Firewall* -------------------------------------------------------------------------------- /Chapter01/5.4.1_Get-Alias.ps1: -------------------------------------------------------------------------------- 1 | Get-Alias -------------------------------------------------------------------------------- /Chapter01/5.4.2_Get-Alias_ByName.ps1: -------------------------------------------------------------------------------- 1 | Get-Alias dir -------------------------------------------------------------------------------- /Chapter01/5.5.2_Get-Alias_ByDefinition.ps1: -------------------------------------------------------------------------------- 1 | Get-Alias -Definition Get-ChildItem -------------------------------------------------------------------------------- /Chapter01/5.5.3_AliasUse.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/5.5.3_AliasUse.ps1 -------------------------------------------------------------------------------- /Chapter01/5.5.4_New-Alias.ps1: -------------------------------------------------------------------------------- 1 | New-Alias grep -Value Select-String -------------------------------------------------------------------------------- /Chapter01/6.1.1_PositionalParams.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/6.1.1_PositionalParams.ps1 -------------------------------------------------------------------------------- /Chapter01/6.1.5_SwitchParam.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem -Recurse:$false -------------------------------------------------------------------------------- /Chapter01/6.1.6_CommonParams.ps1: -------------------------------------------------------------------------------- 1 | Get-Help about_CommonParameters -------------------------------------------------------------------------------- /Chapter01/6.1.7_Verbose.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/6.1.7_Verbose.ps1 -------------------------------------------------------------------------------- /Chapter01/6.2.1_ParameterValues.ps1: -------------------------------------------------------------------------------- 1 | Get-CimInstance -ClassName Win32_OperatingSystem -------------------------------------------------------------------------------- /Chapter01/6.2.2_ParameterValues_Array.ps1: -------------------------------------------------------------------------------- 1 | Get-Process -Name powershell, explorer, smss -------------------------------------------------------------------------------- /Chapter01/6.3.1_ParameterSets.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/6.3.1_ParameterSets.ps1 -------------------------------------------------------------------------------- /Chapter01/6.4.10_BypassingWhatIf.ps1: -------------------------------------------------------------------------------- 1 | 'Some message' | Out-File $env:TEMP\test.txt -WhatIf:$false -------------------------------------------------------------------------------- /Chapter01/6.4.11_WhatIfPreference.ps1: -------------------------------------------------------------------------------- 1 | $WhatIfPreference = $true -------------------------------------------------------------------------------- /Chapter01/6.4.12_ConfirmAndWhatIfPreference.ps1: -------------------------------------------------------------------------------- 1 | $WhatIfPreference = $true 2 | New-Item NewFile.txt -Confirm -------------------------------------------------------------------------------- /Chapter01/6.4.1_PreferenceVariables.ps1: -------------------------------------------------------------------------------- 1 | Get-Help about_Preference_Variables -------------------------------------------------------------------------------- /Chapter01/6.4.2_Force.ps1: -------------------------------------------------------------------------------- 1 | Get-Help Remove-Item -Parameter Force -------------------------------------------------------------------------------- /Chapter01/6.4.3_Confirm.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/6.4.3_Confirm.ps1 -------------------------------------------------------------------------------- /Chapter01/6.4.4_Confirm_False.ps1: -------------------------------------------------------------------------------- 1 | Remove-Item .\IMadeThisUp.txt -Confirm:$false -------------------------------------------------------------------------------- /Chapter01/6.4.5_Clear-RecycleBin_Confirm.ps1: -------------------------------------------------------------------------------- 1 | Clear-RecycleBin -------------------------------------------------------------------------------- /Chapter01/6.4.6_Clear-RecycleBin_Confirm_False.ps1: -------------------------------------------------------------------------------- 1 | Clear-RecycleBin -Confirm:$false -------------------------------------------------------------------------------- /Chapter01/6.4.7_ConfirmPreference.ps1: -------------------------------------------------------------------------------- 1 | $ConfirmPreference 2 | 3 | # Expects High by default -------------------------------------------------------------------------------- /Chapter01/6.4.8_ConfirmPreference_Set.ps1: -------------------------------------------------------------------------------- 1 | $ConfirmPreference = 'Low' -------------------------------------------------------------------------------- /Chapter01/6.4.9_WhatIf.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/6.4.9_WhatIf.ps1 -------------------------------------------------------------------------------- /Chapter01/6.5.13_Force_Error.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/6.5.13_Force_Error.ps1 -------------------------------------------------------------------------------- /Chapter01/6.5.14_UsingForce.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/6.5.14_UsingForce.ps1 -------------------------------------------------------------------------------- /Chapter01/7.1.1_Providers.ps1: -------------------------------------------------------------------------------- 1 | Get-Help about_Providers -------------------------------------------------------------------------------- /Chapter01/7.1.2_Get-PSProvider.ps1: -------------------------------------------------------------------------------- 1 | Get-PSProvider -------------------------------------------------------------------------------- /Chapter01/7.1.3_ProviderHelp.ps1: -------------------------------------------------------------------------------- 1 | Get-Help -Name Certificate -Category Provider 2 | -------------------------------------------------------------------------------- /Chapter01/7.1.4_ProviderHelpCategory.ps1: -------------------------------------------------------------------------------- 1 | Get-Help -Category Provider -------------------------------------------------------------------------------- /Chapter01/7.2.1_Get-PSDrive.ps1: -------------------------------------------------------------------------------- 1 | Get-PSDrive -------------------------------------------------------------------------------- /Chapter01/7.2.2_CertProvider.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/7.2.2_CertProvider.ps1 -------------------------------------------------------------------------------- /Chapter01/7.2.3_New-PSDrive.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/7.2.3_New-PSDrive.ps1 -------------------------------------------------------------------------------- /Chapter01/7.2.4_Get-ChildItem_HKU.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem HKU: 2 | 3 | -------------------------------------------------------------------------------- /Chapter01/7.3.1_UsingProviders_FileSystem.ps1: -------------------------------------------------------------------------------- 1 | Set-Location C: 2 | Get-ChildItem -File -------------------------------------------------------------------------------- /Chapter01/7.4.1_UsingProviders_Certificate.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem Cert:\LocalMachine\Root -ExpiringInDays 730 -------------------------------------------------------------------------------- /Chapter01/8.1.1_Splatting.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/8.1.1_Splatting.ps1 -------------------------------------------------------------------------------- /Chapter01/8.2.1_LongCommand.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/8.2.1_LongCommand.ps1 -------------------------------------------------------------------------------- /Chapter01/8.2.2_UsingTick.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/8.2.2_UsingTick.ps1 -------------------------------------------------------------------------------- /Chapter01/8.4.1_ExampleCommand.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter01/8.4.1_ExampleCommand.ps1 -------------------------------------------------------------------------------- /Chapter02/1.1.1_New-Module.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter02/1.1.1_New-Module.ps1 -------------------------------------------------------------------------------- /Chapter02/1.2.1_Get-Module.ps1: -------------------------------------------------------------------------------- 1 | Get-Module -------------------------------------------------------------------------------- /Chapter02/1.2.2_Get-Module_ListAvailable.ps1: -------------------------------------------------------------------------------- 1 | Get-Module -ListAvailable -------------------------------------------------------------------------------- /Chapter02/1.3.1_PSMODULEPATH.ps1: -------------------------------------------------------------------------------- 1 | $env:PSModulePath -split ';' -------------------------------------------------------------------------------- /Chapter02/1.3.2_Set_PSMODULEPATH.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter02/1.3.2_Set_PSMODULEPATH.ps1 -------------------------------------------------------------------------------- /Chapter02/1.3.3_PSMODULEPATH_PSCore.ps1: -------------------------------------------------------------------------------- 1 | $env:PSModulePath -split ';' -------------------------------------------------------------------------------- /Chapter02/1.3.4_Import-Module_PSCore.ps1: -------------------------------------------------------------------------------- 1 | Import-Module NetSecurity -SkipEditionCheck -------------------------------------------------------------------------------- /Chapter02/2.1.1_Autoloading.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter02/2.1.1_Autoloading.ps1 -------------------------------------------------------------------------------- /Chapter02/2.1.2_Import-Module.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter02/2.1.2_Import-Module.ps1 -------------------------------------------------------------------------------- /Chapter02/2.1.3_Get-Command.ps1: -------------------------------------------------------------------------------- 1 | Get-Command -Module PSWorkflow -------------------------------------------------------------------------------- /Chapter02/2.1.4_Import-Module_MaximumVersion.ps1: -------------------------------------------------------------------------------- 1 | Import-Module PSScriptAnalyzer -MaxmimumVersion 1.7.0 -------------------------------------------------------------------------------- /Chapter02/2.3.1_Find-Module.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter02/2.3.1_Find-Module.ps1 -------------------------------------------------------------------------------- /Chapter02/2.3.2_Find-Module_Filter.ps1: -------------------------------------------------------------------------------- 1 | Find-Module -Filter IIS -------------------------------------------------------------------------------- /Chapter02/2.4.1_Install-Module.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter02/2.4.1_Install-Module.ps1 -------------------------------------------------------------------------------- /Chapter02/2.4.2_Install-Module_Scope.ps1: -------------------------------------------------------------------------------- 1 | Install-Module carbon -Scope CurrentUser -------------------------------------------------------------------------------- /Chapter02/2.4.3_Install-Module_Scope_Force.ps1: -------------------------------------------------------------------------------- 1 | Install-Module carbon -Scope CurrentUser -Force -------------------------------------------------------------------------------- /Chapter02/2.4.4_Install-Module_Reinstall.ps1: -------------------------------------------------------------------------------- 1 | Install-Module posh-git -Force -------------------------------------------------------------------------------- /Chapter02/2.6.1_Save-Module.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter02/2.6.1_Save-Module.ps1 -------------------------------------------------------------------------------- /Chapter02/3.1.1_InstallWindowsCompatibility.ps1: -------------------------------------------------------------------------------- 1 | Install-Module WindowsCompatibility -Scope CurrentUser -------------------------------------------------------------------------------- /Chapter02/4.1.1_Get-PSSnapIn.ps1: -------------------------------------------------------------------------------- 1 | Get-PSSnapIn -Registered -------------------------------------------------------------------------------- /Chapter02/4.2.1_Add-PSSnapIn.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter02/4.2.1_Add-PSSnapIn.ps1 -------------------------------------------------------------------------------- /Chapter02/4.2.3_Get-Command_SnapIn.ps1: -------------------------------------------------------------------------------- 1 | Get-Command -Module WDeploySnapin3.0 -------------------------------------------------------------------------------- /Chapter03/1.1.1.StdOut.ps1: -------------------------------------------------------------------------------- 1 | $stdout = Get-CimInstance -ClassName Win32_ComputerSystem 2 | -------------------------------------------------------------------------------- /Chapter03/1.2.1.StdOut.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/1.2.1.StdOut.ps1 -------------------------------------------------------------------------------- /Chapter03/1.3.1.StdOut.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/1.3.1.StdOut.ps1 -------------------------------------------------------------------------------- /Chapter03/2.1.1.Get-Member.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/2.1.1.Get-Member.ps1 -------------------------------------------------------------------------------- /Chapter03/2.2.1.Property.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/2.2.1.Property.ps1 -------------------------------------------------------------------------------- /Chapter03/2.2.2.Property_Parens.ps1: -------------------------------------------------------------------------------- 1 | (Get-Process -Id $PID).Name -------------------------------------------------------------------------------- /Chapter03/2.2.4.Property_Sub-property_Parens.ps1: -------------------------------------------------------------------------------- 1 | (Get-Process -Id $PID).StartTime.DayOfWeek -------------------------------------------------------------------------------- /Chapter03/2.3.1.Method_show.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/2.3.1.Method_show.ps1 -------------------------------------------------------------------------------- /Chapter03/2.3.2.Method_invoke.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/2.3.2.Method_invoke.ps1 -------------------------------------------------------------------------------- /Chapter03/2.3.3.Method_arguments.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/2.3.3.Method_arguments.ps1 -------------------------------------------------------------------------------- /Chapter03/2.3.4.Method_results.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/2.3.4.Method_results.ps1 -------------------------------------------------------------------------------- /Chapter03/2.3.5.Method_close.ps1: -------------------------------------------------------------------------------- 1 | $tcpClient.Close() -------------------------------------------------------------------------------- /Chapter03/2.3.6.Method_ToString.ps1: -------------------------------------------------------------------------------- 1 | (Get-Date).ToString('u') 2 | 3 | # Expects output similar to: 4 | # 5 | # 2016-12-08 21:18:49Z -------------------------------------------------------------------------------- /Chapter03/2.3.7.Get-Date_Format_alternative.ps1: -------------------------------------------------------------------------------- 1 | Get-Date -Format u 2 | 3 | # Expects output similar to: 4 | # 5 | # 2016-12-08 21:19:31Z -------------------------------------------------------------------------------- /Chapter03/2.3.8.Method_chaining.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/2.3.8.Method_chaining.ps1 -------------------------------------------------------------------------------- /Chapter03/2.4.1.AccessModifiers.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/2.4.1.AccessModifiers.ps1 -------------------------------------------------------------------------------- /Chapter03/2.4.4.AccessModifiers_Result.ps1: -------------------------------------------------------------------------------- 1 | Get-Item NewFile.txt | Select-Object -ExpandProperty CreationTime -------------------------------------------------------------------------------- /Chapter03/3.2.1.ForEach-Object.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/3.2.1.ForEach-Object.ps1 -------------------------------------------------------------------------------- /Chapter03/3.2.2.ForEach-Object_MemberExpansion.ps1: -------------------------------------------------------------------------------- 1 | Get-Process | ForEach-Object Path -------------------------------------------------------------------------------- /Chapter03/3.3.1.Where-Object.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/3.3.1.Where-Object.ps1 -------------------------------------------------------------------------------- /Chapter03/4.1.1.Select-Object.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/4.1.1.Select-Object.ps1 -------------------------------------------------------------------------------- /Chapter03/4.1.4.Select-Object_First.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem C:\ -Recurse | Select-Object -First 2 -------------------------------------------------------------------------------- /Chapter03/4.1.5.Select-Object_Last.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem C:\ | Select-Object -Last 3 -------------------------------------------------------------------------------- /Chapter03/4.1.6.Select-Object_Skip.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem C:\ | Select-Object -Skip 2 -Last 1 -------------------------------------------------------------------------------- /Chapter03/4.1.9.ExampleSet.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/4.1.9.ExampleSet.ps1 -------------------------------------------------------------------------------- /Chapter03/4.2.1.Sort-Object.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/4.2.1.Sort-Object.ps1 -------------------------------------------------------------------------------- /Chapter03/4.2.3.Sort-Object_Property.ps1: -------------------------------------------------------------------------------- 1 | Get-Process | Sort-Object -Property Id -------------------------------------------------------------------------------- /Chapter03/5.1.1.Group-Object.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/5.1.1.Group-Object.ps1 -------------------------------------------------------------------------------- /Chapter03/5.1.3.Group-Object_Property.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem C:\Windows\Assembly -Filter *.dll -Recurse | 2 | Group-Object Name -------------------------------------------------------------------------------- /Chapter03/5.2.1.Measure-Object.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/5.2.1.Measure-Object.ps1 -------------------------------------------------------------------------------- /Chapter03/6.1.1.Compare-Object.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/6.1.1.Compare-Object.ps1 -------------------------------------------------------------------------------- /Chapter03/7.1.1.Export-Csv.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/7.1.1.Export-Csv.ps1 -------------------------------------------------------------------------------- /Chapter03/7.1.3.Export-Csv_Append.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/7.1.3.Export-Csv_Append.ps1 -------------------------------------------------------------------------------- /Chapter03/7.1.5.ConvertTo-Csv.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/7.1.5.ConvertTo-Csv.ps1 -------------------------------------------------------------------------------- /Chapter03/7.2.1.Import-Csv.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/7.2.1.Import-Csv.ps1 -------------------------------------------------------------------------------- /Chapter03/7.2.4.ConvertFrom-Csv.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/7.2.4.ConvertFrom-Csv.ps1 -------------------------------------------------------------------------------- /Chapter03/7.3.1.Export-CliXml.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/7.3.1.Export-CliXml.ps1 -------------------------------------------------------------------------------- /Chapter03/7.3.2.Import-CliXml.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter03/7.3.2.Import-CliXml.ps1 -------------------------------------------------------------------------------- /Chapter04/1.1.2.OperatorPrecedence_Shift.ps1: -------------------------------------------------------------------------------- 1 | 2 * 4 -shl 2 + 2 -------------------------------------------------------------------------------- /Chapter04/1.1.3.OperatorPrecedence_Parens.ps1: -------------------------------------------------------------------------------- 1 | (3 + 2) * 2 -------------------------------------------------------------------------------- /Chapter04/1.2.1.Addition_Simple.ps1: -------------------------------------------------------------------------------- 1 | 2.71828 + 3.14159 -------------------------------------------------------------------------------- /Chapter04/1.2.2.Concatenation.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/1.2.2.Concatenation.ps1 -------------------------------------------------------------------------------- /Chapter04/1.2.3.Concatenation_casting.ps1: -------------------------------------------------------------------------------- 1 | 'hello number ' + 1 -------------------------------------------------------------------------------- /Chapter04/1.2.6.JoinArray.ps1: -------------------------------------------------------------------------------- 1 | @(1, 2) + 3 -------------------------------------------------------------------------------- /Chapter04/1.2.8.JoinHashtable.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/1.2.8.JoinHashtable.ps1 -------------------------------------------------------------------------------- /Chapter04/1.3.1.Subtraction.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/1.3.1.Subtraction.ps1 -------------------------------------------------------------------------------- /Chapter04/1.4.1.Multiplication.ps1: -------------------------------------------------------------------------------- 1 | 2.5 * 2 -------------------------------------------------------------------------------- /Chapter04/1.4.2.Multiplication_Strings.ps1: -------------------------------------------------------------------------------- 1 | 'hello' * 3 -------------------------------------------------------------------------------- /Chapter04/1.5.1.Division.ps1: -------------------------------------------------------------------------------- 1 | 20 / 5 -------------------------------------------------------------------------------- /Chapter04/1.6.1.Remainder.ps1: -------------------------------------------------------------------------------- 1 | 3 % 2 -------------------------------------------------------------------------------- /Chapter04/1.7.1.LeftShift.ps1: -------------------------------------------------------------------------------- 1 | 78 -shl 1 -------------------------------------------------------------------------------- /Chapter04/1.7.2.RightShift.ps1: -------------------------------------------------------------------------------- 1 | 156 -shr 1 2 | 3 | # Expects output: 4 | # 5 | # 78 -------------------------------------------------------------------------------- /Chapter04/1.7.3.shl_OutOfRange.ps1: -------------------------------------------------------------------------------- 1 | 3 -shr 1 2 | 3 | # Expects output: 4 | # 5 | # 1 -------------------------------------------------------------------------------- /Chapter04/1.7.4.shl_OutOfRange_Byte.ps1: -------------------------------------------------------------------------------- 1 | ([Byte]255) -shl 1 2 | 3 | # Expects output: 4 | # 5 | # 254 -------------------------------------------------------------------------------- /Chapter04/1.7.5.shl_Int16.ps1: -------------------------------------------------------------------------------- 1 | ([Int16]255) -shl 1 2 | 3 | # Expects output: 4 | # 5 | # 510 -------------------------------------------------------------------------------- /Chapter04/1.7.6.shl_SIgning.ps1: -------------------------------------------------------------------------------- 1 | ([SByte]64) -shl 1 2 | 3 | # Expects output: 4 | # 5 | # -128 -------------------------------------------------------------------------------- /Chapter04/1.7.7.shl_IPAddress.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/1.7.7.shl_IPAddress.ps1 -------------------------------------------------------------------------------- /Chapter04/2.1.1.Assignment.ps1: -------------------------------------------------------------------------------- 1 | $variable = 'some value' -------------------------------------------------------------------------------- /Chapter04/2.1.10.AddArrayToArray.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/2.1.10.AddArrayToArray.ps1 -------------------------------------------------------------------------------- /Chapter04/2.1.11.AddToHashtable.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/2.1.11.AddToHashtable.ps1 -------------------------------------------------------------------------------- /Chapter04/2.1.12.SubtractAndAssign.ps1: -------------------------------------------------------------------------------- 1 | $i = 20 2 | $i -= 2 -------------------------------------------------------------------------------- /Chapter04/2.1.3.AddAndAssign.ps1: -------------------------------------------------------------------------------- 1 | $i = 1 2 | $i += 20 -------------------------------------------------------------------------------- /Chapter04/2.1.7.TypeMismatch.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/2.1.7.TypeMismatch.ps1 -------------------------------------------------------------------------------- /Chapter04/2.1.8.CastToString.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/2.1.8.CastToString.ps1 -------------------------------------------------------------------------------- /Chapter04/2.1.9.AddToArray.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/2.1.9.AddToArray.ps1 -------------------------------------------------------------------------------- /Chapter04/2.2.1.MultiplyAndAssign.ps1: -------------------------------------------------------------------------------- 1 | $i = 2 2 | $i *= 2 -------------------------------------------------------------------------------- /Chapter04/2.2.5.DivideAndAssign.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/2.2.5.DivideAndAssign.ps1 -------------------------------------------------------------------------------- /Chapter04/3.1.1.Equals.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/3.1.1.Equals.ps1 -------------------------------------------------------------------------------- /Chapter04/3.2.2.ArrayEqualsNull.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/3.2.2.ArrayEqualsNull.ps1 -------------------------------------------------------------------------------- /Chapter04/3.2.4.ImplicitBoolean.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/3.2.4.ImplicitBoolean.ps1 -------------------------------------------------------------------------------- /Chapter04/3.2.5.NullEqualsArray.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/3.2.5.NullEqualsArray.ps1 -------------------------------------------------------------------------------- /Chapter04/3.3.1.Equal_Examples.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/3.3.1.Equal_Examples.ps1 -------------------------------------------------------------------------------- /Chapter04/3.3.2.NotEqual_Examples.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/3.3.2.NotEqual_Examples.ps1 -------------------------------------------------------------------------------- /Chapter04/3.4.1.LikeAndNotLike.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/3.4.1.LikeAndNotLike.ps1 -------------------------------------------------------------------------------- /Chapter04/3.6.2.In.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/3.6.2.In.ps1 -------------------------------------------------------------------------------- /Chapter04/4.1.1.Match.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/4.1.1.Match.ps1 -------------------------------------------------------------------------------- /Chapter04/4.1.2.MatchAndMatches.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/4.1.2.MatchAndMatches.ps1 -------------------------------------------------------------------------------- /Chapter04/4.2.1.Replace.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/4.2.1.Replace.ps1 -------------------------------------------------------------------------------- /Chapter04/4.2.3.ReplaceWithTokens.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/4.2.3.ReplaceWithTokens.ps1 -------------------------------------------------------------------------------- /Chapter04/4.3.1.Split.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/4.3.1.Split.ps1 -------------------------------------------------------------------------------- /Chapter04/5.1.1.BinaryAnd.ps1: -------------------------------------------------------------------------------- 1 | 11 -band 6 -------------------------------------------------------------------------------- /Chapter04/5.2.1.BinaryOr.ps1: -------------------------------------------------------------------------------- 1 | 11 -bor 12 -------------------------------------------------------------------------------- /Chapter04/5.3.1.BinaryExclusiveOr.ps1: -------------------------------------------------------------------------------- 1 | 6 -bxor 13 -------------------------------------------------------------------------------- /Chapter04/5.4.1.BinaryNot.ps1: -------------------------------------------------------------------------------- 1 | -bnot 122 -------------------------------------------------------------------------------- /Chapter04/6.1.1.And.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/6.1.1.And.ps1 -------------------------------------------------------------------------------- /Chapter04/6.2.1.Or.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/6.2.1.Or.ps1 -------------------------------------------------------------------------------- /Chapter04/6.3.1.ExclusiveOr.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/6.3.1.ExclusiveOr.ps1 -------------------------------------------------------------------------------- /Chapter04/6.4.1.Not.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/6.4.1.Not.ps1 -------------------------------------------------------------------------------- /Chapter04/7.1.1.As.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/7.1.1.As.ps1 -------------------------------------------------------------------------------- /Chapter04/7.1.2.As_TestForType.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/7.1.2.As_TestForType.ps1 -------------------------------------------------------------------------------- /Chapter04/7.2.1.IsAndIsNot.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/7.2.1.IsAndIsNot.ps1 -------------------------------------------------------------------------------- /Chapter04/8.2.1.RedirectToFile.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/8.2.1.RedirectToFile.ps1 -------------------------------------------------------------------------------- /Chapter04/8.4.1.RedirectToNull.ps1: -------------------------------------------------------------------------------- 1 | Get-Process > $null -------------------------------------------------------------------------------- /Chapter04/8.4.2.RedirectToNull_EmptyString.ps1: -------------------------------------------------------------------------------- 1 | Get-Process > '' -------------------------------------------------------------------------------- /Chapter04/9.1.1.Call.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/9.1.1.Call.ps1 -------------------------------------------------------------------------------- /Chapter04/9.1.2.CallScriptBlock.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/9.1.2.CallScriptBlock.ps1 -------------------------------------------------------------------------------- /Chapter04/9.1.3.CallCommandAsString.ps1: -------------------------------------------------------------------------------- 1 | & 'ipconfig' '/displaydns' 2 | -------------------------------------------------------------------------------- /Chapter04/9.2.1.Comma.ps1: -------------------------------------------------------------------------------- 1 | $array = 1, 2, 3, 4 -------------------------------------------------------------------------------- /Chapter04/9.2.2.SingleElementArray.ps1: -------------------------------------------------------------------------------- 1 | $array = ,1 2 | -------------------------------------------------------------------------------- /Chapter04/9.3.1.Format.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/9.3.1.Format.ps1 -------------------------------------------------------------------------------- /Chapter04/9.3.2.Format_Percentage.ps1: -------------------------------------------------------------------------------- 1 | 'The pass mark is {0:P}' -f 0.8 -------------------------------------------------------------------------------- /Chapter04/9.3.3.Format_Hex.ps1: -------------------------------------------------------------------------------- 1 | '244 in Hexadecimal is {0:X2}' -f 244 -------------------------------------------------------------------------------- /Chapter04/9.3.4.Format_Currency.ps1: -------------------------------------------------------------------------------- 1 | 'The price is {0:C2}' -f 199 -------------------------------------------------------------------------------- /Chapter04/9.4.1.PostIncrement.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/9.4.1.PostIncrement.ps1 -------------------------------------------------------------------------------- /Chapter04/9.4.2.PostDecrement.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/9.4.2.PostDecrement.ps1 -------------------------------------------------------------------------------- /Chapter04/9.5.1.Join.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/9.5.1.Join.ps1 -------------------------------------------------------------------------------- /Chapter04/9.5.2.JoinNoSeparator.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter04/9.5.2.JoinNoSeparator.ps1 -------------------------------------------------------------------------------- /Chapter05/1.1.1.VariableNames.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/1.1.1.VariableNames.ps1 -------------------------------------------------------------------------------- /Chapter05/1.1.3.Interpolation.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/1.1.3.Interpolation.ps1 -------------------------------------------------------------------------------- /Chapter05/1.1.5.Assignment.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/1.1.5.Assignment.ps1 -------------------------------------------------------------------------------- /Chapter05/1.1.6.AssignmentMultiple.ps1: -------------------------------------------------------------------------------- 1 | $i = $j = 0 -------------------------------------------------------------------------------- /Chapter05/2.1.1.Clear-Variable.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/2.1.1.Clear-Variable.ps1 -------------------------------------------------------------------------------- /Chapter05/2.2.1.Get-Variable.ps1: -------------------------------------------------------------------------------- 1 | Get-Variable | Select-Object Name, Description -------------------------------------------------------------------------------- /Chapter05/2.3.1.New-Variable.ps1: -------------------------------------------------------------------------------- 1 | New-Variable -Name today -Value (Get-Date) -------------------------------------------------------------------------------- /Chapter05/2.3.2.New-Variable_Equivalent.ps1: -------------------------------------------------------------------------------- 1 | $today = Get-Date -------------------------------------------------------------------------------- /Chapter05/2.4.1.Remove-Variable.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/2.4.1.Remove-Variable.ps1 -------------------------------------------------------------------------------- /Chapter05/2.5.1.Set-Variable.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/2.5.1.Set-Variable.ps1 -------------------------------------------------------------------------------- /Chapter05/2.5.2.Set-Variable_Private.ps1: -------------------------------------------------------------------------------- 1 | Set-Variable objectCount -Option Private -------------------------------------------------------------------------------- /Chapter05/3.1.1.VariableProvider.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem variable: -------------------------------------------------------------------------------- /Chapter05/3.1.2.VariableProvider_Test-Path.ps1: -------------------------------------------------------------------------------- 1 | Test-Path variable:\VerbosePreference -------------------------------------------------------------------------------- /Chapter05/3.1.4.VariableProvider_Get-Content.ps1: -------------------------------------------------------------------------------- 1 | Get-COntent variable:\OutputEncoding -------------------------------------------------------------------------------- /Chapter05/4.1.1.Scope.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/4.1.1.Scope.ps1 -------------------------------------------------------------------------------- /Chapter05/4.1.2.Scope_Parent.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/4.1.2.Scope_Parent.ps1 -------------------------------------------------------------------------------- /Chapter05/4.2.1.Scope_Private.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/4.2.1.Scope_Private.ps1 -------------------------------------------------------------------------------- /Chapter05/4.3.1.Scope_Script.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/4.3.1.Scope_Script.ps1 -------------------------------------------------------------------------------- /Chapter05/5.1.1.TypeConversion_ToString.ps1: -------------------------------------------------------------------------------- 1 | [String](Get-Date) 2 | 3 | # Expects output: 4 | # 5 | # 10/27/2016 13:14:32 -------------------------------------------------------------------------------- /Chapter05/5.1.3.AssignedType.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/5.1.3.AssignedType.ps1 -------------------------------------------------------------------------------- /Chapter05/5.1.5.TypePersistence.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/5.1.5.TypePersistence.ps1 -------------------------------------------------------------------------------- /Chapter05/6.1.1.ValueTypeAssignment.ps1: -------------------------------------------------------------------------------- 1 | $i = $j = 5 -------------------------------------------------------------------------------- /Chapter05/7.1.1.CreateArray.ps1: -------------------------------------------------------------------------------- 1 | $myArray = @() -------------------------------------------------------------------------------- /Chapter05/7.1.2.CreateArrayOfSize.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/7.1.2.CreateArrayOfSize.ps1 -------------------------------------------------------------------------------- /Chapter05/7.1.3.ArrayOfElements.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/7.1.3.ArrayOfElements.ps1 -------------------------------------------------------------------------------- /Chapter05/7.1.6.ArrayOfElements_MixedType.ps1: -------------------------------------------------------------------------------- 1 | $myThings = "Hello world", 2, 34.23, (Get-Date) -------------------------------------------------------------------------------- /Chapter05/7.2.1.ArrayOfType.ps1: -------------------------------------------------------------------------------- 1 | [Int32[]]$myNumbers = 1, 2, $null, 3.45 -------------------------------------------------------------------------------- /Chapter05/7.3.1.AddElement.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/7.3.1.AddElement.ps1 -------------------------------------------------------------------------------- /Chapter05/7.4.1.GetByIndex.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/7.4.1.GetByIndex.ps1 -------------------------------------------------------------------------------- /Chapter05/7.4.2.IndexFromEnd.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/7.4.2.IndexFromEnd.ps1 -------------------------------------------------------------------------------- /Chapter05/7.4.3.IndexRange.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/7.4.3.IndexRange.ps1 -------------------------------------------------------------------------------- /Chapter05/7.4.4.ArrayOfIndexes.ps1: -------------------------------------------------------------------------------- 1 | $myArray[0..2 + 6..8 + -1] -------------------------------------------------------------------------------- /Chapter05/7.4.6.ArrayOfIndexes_FirstMustBeArray_Cause.ps1: -------------------------------------------------------------------------------- 1 | 0..2 + 6..8 + -1 -------------------------------------------------------------------------------- /Chapter05/7.5.1.Updating.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/7.5.1.Updating.ps1 -------------------------------------------------------------------------------- /Chapter05/7.5.2.UpdatingInLoop.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/7.5.2.UpdatingInLoop.ps1 -------------------------------------------------------------------------------- /Chapter05/7.6.10.RemovingElements_ByValue_Start.ps1: -------------------------------------------------------------------------------- 1 | $oldArray = 1..100 -------------------------------------------------------------------------------- /Chapter05/7.6.12.RemovingElements_ByValue_IndexOf.ps1: -------------------------------------------------------------------------------- 1 | $index = $oldArray.IndexOf(50) -------------------------------------------------------------------------------- /Chapter05/7.6.14.Clear.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/7.6.14.Clear.ps1 -------------------------------------------------------------------------------- /Chapter05/7.6.2.RemovingElements_NullElements_Count.ps1: -------------------------------------------------------------------------------- 1 | $myArray.Count 2 | 3 | # Expects output: 4 | # 5 | # 5 -------------------------------------------------------------------------------- /Chapter05/7.6.3.RemovingElements_NullElements_Count.ps1: -------------------------------------------------------------------------------- 1 | $myArray.Count 2 | 3 | # Expects output: 4 | # 5 | # 5 -------------------------------------------------------------------------------- /Chapter05/7.6.4.RemovingElements_NullElements_Pipeline.ps1: -------------------------------------------------------------------------------- 1 | $myArray | ForEach-Object { Write-Host $_ } -------------------------------------------------------------------------------- /Chapter05/7.6.6.RemovingElements_ByIndex.ps1: -------------------------------------------------------------------------------- 1 | $oldArray = 1..100 -------------------------------------------------------------------------------- /Chapter05/7.7.1.SetVariablesFromArray.ps1: -------------------------------------------------------------------------------- 1 | $i, $j = 1, 2 -------------------------------------------------------------------------------- /Chapter05/7.7.3.SetVariablesFromArray_Overflow.ps1: -------------------------------------------------------------------------------- 1 | $i, $j, $k = 1, 2, 3, 4, 5 -------------------------------------------------------------------------------- /Chapter05/7.7.4.SetVariablesFromArray_Underrun.ps1: -------------------------------------------------------------------------------- 1 | $i, $j, $k = 1, 2 -------------------------------------------------------------------------------- /Chapter05/7.8.4.JaggedArray.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/7.8.4.JaggedArray.ps1 -------------------------------------------------------------------------------- /Chapter05/8.0.1.CommandsUsingHashtables.ps1: -------------------------------------------------------------------------------- 1 | Get-Command -ParameterType Hashtable -------------------------------------------------------------------------------- /Chapter05/8.1.1.CreateEmptyHashtable.ps1: -------------------------------------------------------------------------------- 1 | $hashtable = @{} -------------------------------------------------------------------------------- /Chapter05/8.2.1.AddMethod.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/8.2.1.AddMethod.ps1 -------------------------------------------------------------------------------- /Chapter05/8.2.3.ContainsMethod.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/8.2.3.ContainsMethod.ps1 -------------------------------------------------------------------------------- /Chapter05/8.2.4.ImplicitAdd.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/8.2.4.ImplicitAdd.ps1 -------------------------------------------------------------------------------- /Chapter05/8.2.6.UpdateOnly.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/8.2.6.UpdateOnly.ps1 -------------------------------------------------------------------------------- /Chapter05/8.2.7.AddOnly.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/8.2.7.AddOnly.ps1 -------------------------------------------------------------------------------- /Chapter05/8.2.9.KeysArray.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/8.2.9.KeysArray.ps1 -------------------------------------------------------------------------------- /Chapter05/8.3.1.AccessKey.ps1: -------------------------------------------------------------------------------- 1 | $hashtable["Key1"] -------------------------------------------------------------------------------- /Chapter05/8.3.2.AccessKey_Alternative.ps1: -------------------------------------------------------------------------------- 1 | $hashtable = @{1 = 'one'} -------------------------------------------------------------------------------- /Chapter05/8.4.1.Start.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/8.4.1.Start.ps1 -------------------------------------------------------------------------------- /Chapter05/8.4.2.KeysProperty.ps1: -------------------------------------------------------------------------------- 1 | $hashtable.Keys -------------------------------------------------------------------------------- /Chapter05/8.4.3.ValuesProperty.ps1: -------------------------------------------------------------------------------- 1 | $hashtable.Values -------------------------------------------------------------------------------- /Chapter05/8.4.4.Loop.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/8.4.4.Loop.ps1 -------------------------------------------------------------------------------- /Chapter05/8.5.1.RemoveMethod.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/8.5.1.RemoveMethod.ps1 -------------------------------------------------------------------------------- /Chapter05/8.5.3.ClearMethod.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/8.5.3.ClearMethod.ps1 -------------------------------------------------------------------------------- /Chapter05/9.1.1.List.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.1.1.List.ps1 -------------------------------------------------------------------------------- /Chapter05/9.1.10.RemoveAll.ps1: -------------------------------------------------------------------------------- 1 | $list.RemoveAll( { $args[0] -eq "David" } ) 2 | -------------------------------------------------------------------------------- /Chapter05/9.1.11.Reassign.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.1.11.Reassign.ps1 -------------------------------------------------------------------------------- /Chapter05/9.1.2.ArrayList.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.1.2.ArrayList.ps1 -------------------------------------------------------------------------------- /Chapter05/9.1.3.AddMethod.ps1: -------------------------------------------------------------------------------- 1 | $list.Add("David") -------------------------------------------------------------------------------- /Chapter05/9.1.4.InsertMethod.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.1.4.InsertMethod.ps1 -------------------------------------------------------------------------------- /Chapter05/9.1.6.FindIndex.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.1.6.FindIndex.ps1 -------------------------------------------------------------------------------- /Chapter05/9.1.7.IndexOf.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.1.7.IndexOf.ps1 -------------------------------------------------------------------------------- /Chapter05/9.1.8.BinarySearch.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.1.8.BinarySearch.ps1 -------------------------------------------------------------------------------- /Chapter05/9.1.9.RemoveAndRemoveAt.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.1.9.RemoveAndRemoveAt.ps1 -------------------------------------------------------------------------------- /Chapter05/9.2.1.Dictionary.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.2.1.Dictionary.ps1 -------------------------------------------------------------------------------- /Chapter05/9.2.11.KeysProperty.ps1: -------------------------------------------------------------------------------- 1 | $dictionary.Keys -------------------------------------------------------------------------------- /Chapter05/9.2.12.ValuesProperty.ps1: -------------------------------------------------------------------------------- 1 | $dictionary.Values -------------------------------------------------------------------------------- /Chapter05/9.2.13.Loop.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.2.13.Loop.ps1 -------------------------------------------------------------------------------- /Chapter05/9.2.14.RemoveMethod.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.2.14.RemoveMethod.ps1 -------------------------------------------------------------------------------- /Chapter05/9.2.2.AddMethod.ps1: -------------------------------------------------------------------------------- 1 | $dictionary.Add("Computer1", "192.168.10.222") -------------------------------------------------------------------------------- /Chapter05/9.2.3.ContainsKey.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.2.3.ContainsKey.ps1 -------------------------------------------------------------------------------- /Chapter05/9.2.4.PropertyNotation.ps1: -------------------------------------------------------------------------------- 1 | $dictionary.Computer3 = "192.168.10.134" -------------------------------------------------------------------------------- /Chapter05/9.2.5.StronglyTypedKey.ps1: -------------------------------------------------------------------------------- 1 | $dictionary.Add(1, 20) -------------------------------------------------------------------------------- /Chapter05/9.2.7.AccessByKey.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.2.7.AccessByKey.ps1 -------------------------------------------------------------------------------- /Chapter05/9.3.1.Queue.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.3.1.Queue.ps1 -------------------------------------------------------------------------------- /Chapter05/9.3.2.EnumerateQueue.ps1: -------------------------------------------------------------------------------- 1 | $queue.ToArray() -------------------------------------------------------------------------------- /Chapter05/9.3.3.PeekMethod.ps1: -------------------------------------------------------------------------------- 1 | $queue.Peek() -------------------------------------------------------------------------------- /Chapter05/9.3.4.EnqueueMethod.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.3.4.EnqueueMethod.ps1 -------------------------------------------------------------------------------- /Chapter05/9.3.5.DequeueMethod.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.3.5.DequeueMethod.ps1 -------------------------------------------------------------------------------- /Chapter05/9.4.1.Stack.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.4.1.Stack.ps1 -------------------------------------------------------------------------------- /Chapter05/9.4.2.EnumerateStack.ps1: -------------------------------------------------------------------------------- 1 | $stack.ToArray() -------------------------------------------------------------------------------- /Chapter05/9.4.3.PeekMethod.ps1: -------------------------------------------------------------------------------- 1 | $stack.Peek() -------------------------------------------------------------------------------- /Chapter05/9.4.4.PushMethod.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.4.4.PushMethod.ps1 -------------------------------------------------------------------------------- /Chapter05/9.4.5.PopMethod.ps1: -------------------------------------------------------------------------------- 1 | $stack.Pop() # This returns Under the bridge -------------------------------------------------------------------------------- /Chapter05/9.4.6.PopMethod_Empty.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter05/9.4.6.PopMethod_Empty.ps1 -------------------------------------------------------------------------------- /Chapter06/1.1.1.If.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/1.1.1.If.ps1 -------------------------------------------------------------------------------- /Chapter06/1.1.2.ImplicitBoolean.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/1.1.2.ImplicitBoolean.ps1 -------------------------------------------------------------------------------- /Chapter06/1.1.3.BooleanCastTrue.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/1.1.3.BooleanCastTrue.ps1 -------------------------------------------------------------------------------- /Chapter06/1.1.4.BooleanCastFalse.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/1.1.4.BooleanCastFalse.ps1 -------------------------------------------------------------------------------- /Chapter06/1.1.5.IfAndAssign.ps1: -------------------------------------------------------------------------------- 1 | if ($i = 1) { 2 | Write-Host "Implicit true. The variable i is $i" 3 | } -------------------------------------------------------------------------------- /Chapter06/1.2.1.Switch.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/1.2.1.Switch.ps1 -------------------------------------------------------------------------------- /Chapter06/1.2.2.Switch_Break.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/1.2.2.Switch_Break.ps1 -------------------------------------------------------------------------------- /Chapter06/1.2.3.Switch_Default.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/1.2.3.Switch_Default.ps1 -------------------------------------------------------------------------------- /Chapter06/1.2.4.Switch_Array.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/1.2.4.Switch_Array.ps1 -------------------------------------------------------------------------------- /Chapter06/1.2.6.Switch_Wildcard.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/1.2.6.Switch_Wildcard.ps1 -------------------------------------------------------------------------------- /Chapter06/1.2.7.Switch_Regex.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/1.2.7.Switch_Regex.ps1 -------------------------------------------------------------------------------- /Chapter06/1.2.8.Switch_Expression.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/1.2.8.Switch_Expression.ps1 -------------------------------------------------------------------------------- /Chapter06/2.1.1.foreach.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/2.1.1.foreach.ps1 -------------------------------------------------------------------------------- /Chapter06/2.2.1.for.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/2.2.1.for.ps1 -------------------------------------------------------------------------------- /Chapter06/2.2.2.for_Step.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/2.2.2.for_Step.ps1 -------------------------------------------------------------------------------- /Chapter06/2.3.1.do_until.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/2.3.1.do_until.ps1 -------------------------------------------------------------------------------- /Chapter06/2.3.2.do_while.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/2.3.2.do_while.ps1 -------------------------------------------------------------------------------- /Chapter06/2.4.1.while.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/2.4.1.while.ps1 -------------------------------------------------------------------------------- /Chapter06/2.5.1.break.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/2.5.1.break.ps1 -------------------------------------------------------------------------------- /Chapter06/2.5.2.break_nested.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/2.5.2.break_nested.ps1 -------------------------------------------------------------------------------- /Chapter06/2.5.3.continue.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/2.5.3.continue.ps1 -------------------------------------------------------------------------------- /Chapter06/3.1.1.AssignSwitch.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter06/3.1.1.AssignSwitch.ps1 -------------------------------------------------------------------------------- /Chapter07/1.1.1.GetAssemblies.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/1.1.1.GetAssemblies.ps1 -------------------------------------------------------------------------------- /Chapter07/1.1.2.GetAssemblyForType.ps1: -------------------------------------------------------------------------------- 1 | [System.Management.Automation.PowerShell].Assembly -------------------------------------------------------------------------------- /Chapter07/2.1.2.GetAssemblies_ImplicitSystemNamespace_2.ps1: -------------------------------------------------------------------------------- 1 | [Management.Automation.PowerShell].Assembly -------------------------------------------------------------------------------- /Chapter07/5.1.1.Constructors.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/5.1.1.Constructors.ps1 -------------------------------------------------------------------------------- /Chapter07/5.2.1.newMethod.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/5.2.1.newMethod.ps1 -------------------------------------------------------------------------------- /Chapter07/5.2.14.New-Object_Fix.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/5.2.14.New-Object_Fix.ps1 -------------------------------------------------------------------------------- /Chapter07/5.2.15.ChainCasting.ps1: -------------------------------------------------------------------------------- 1 | using namespace System.IO 2 | 3 | [BinaryReader][MemoryStream][Byte[]][Char[]]'hello world' -------------------------------------------------------------------------------- /Chapter07/5.2.2.New-Object.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/5.2.2.New-Object.ps1 -------------------------------------------------------------------------------- /Chapter07/5.2.5.Alternatives.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/5.2.5.Alternatives.ps1 -------------------------------------------------------------------------------- /Chapter07/6.2.1.StaticProperties.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/6.2.1.StaticProperties.ps1 -------------------------------------------------------------------------------- /Chapter07/6.2.2.StaticPropertyInvocation.ps1: -------------------------------------------------------------------------------- 1 | [System.Text.Encoding]::ASCII -------------------------------------------------------------------------------- /Chapter07/6.2.4.StaticFields.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/6.2.4.StaticFields.ps1 -------------------------------------------------------------------------------- /Chapter07/6.3.1.StaticMethods.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/6.3.1.StaticMethods.ps1 -------------------------------------------------------------------------------- /Chapter07/6.3.4.StaticMethodInvocation_Arguments.ps1: -------------------------------------------------------------------------------- 1 | [System.IO.Path]::ChangeExtension("C:\none.exe", "bak") -------------------------------------------------------------------------------- /Chapter07/7.1.1.NonPublicClasses.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/7.1.1.NonPublicClasses.ps1 -------------------------------------------------------------------------------- /Chapter07/8.1.1.TypeAccelerators_PowerShell.ps1: -------------------------------------------------------------------------------- 1 | [PowerShell].Assembly -------------------------------------------------------------------------------- /Chapter07/8.1.5.Accelerators_Get.ps1: -------------------------------------------------------------------------------- 1 | [Accelerators]::Get -------------------------------------------------------------------------------- /Chapter07/9.1.1.UsingAssembly.ps1: -------------------------------------------------------------------------------- 1 | using assembly System.Windows.Forms -------------------------------------------------------------------------------- /Chapter07/9.1.2.Add-Type.ps1: -------------------------------------------------------------------------------- 1 | Add-Type -AssemblyName System.Windows.Forms -------------------------------------------------------------------------------- /Chapter07/9.1.3.gacutil.ps1: -------------------------------------------------------------------------------- 1 | gacutil /l System.Windows.Forms -------------------------------------------------------------------------------- /Chapter07/9.1.4.GacModule.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/9.1.4.GacModule.ps1 -------------------------------------------------------------------------------- /Chapter07/9.1.6.AssemblyFullName.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/9.1.6.AssemblyFullName.ps1 -------------------------------------------------------------------------------- /Chapter07/9.1.7.UsingAssemblyPath.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/9.1.7.UsingAssemblyPath.ps1 -------------------------------------------------------------------------------- /Chapter07/9.2.1.UsingNamespace.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter07/9.2.1.UsingNamespace.ps1 -------------------------------------------------------------------------------- /Chapter08/1.1.1.IndexIntoString.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.1.1.IndexIntoString.ps1 -------------------------------------------------------------------------------- /Chapter08/1.1.3.StringSplitMethodOnArray.ps1: -------------------------------------------------------------------------------- 1 | ('a,b', 'c,d').Split(',') -------------------------------------------------------------------------------- /Chapter08/1.10.1.Contains.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.10.1.Contains.ps1 -------------------------------------------------------------------------------- /Chapter08/1.11.1.MethodChaining.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.11.1.MethodChaining.ps1 -------------------------------------------------------------------------------- /Chapter08/1.2.1.Substring.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.2.1.Substring.ps1 -------------------------------------------------------------------------------- /Chapter08/1.3.1.Split.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.3.1.Split.ps1 -------------------------------------------------------------------------------- /Chapter08/1.3.6.CharArray.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.3.6.CharArray.ps1 -------------------------------------------------------------------------------- /Chapter08/1.3.8.ForceSplitString.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.3.8.ForceSplitString.ps1 -------------------------------------------------------------------------------- /Chapter08/1.4.1.Replace.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.4.1.Replace.ps1 -------------------------------------------------------------------------------- /Chapter08/1.5.1.Trim.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.5.1.Trim.ps1 -------------------------------------------------------------------------------- /Chapter08/1.5.2.Trim_ArrayOfChar.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.5.2.Trim_ArrayOfChar.ps1 -------------------------------------------------------------------------------- /Chapter08/1.5.3.Trim_Overloads.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.5.3.Trim_Overloads.ps1 -------------------------------------------------------------------------------- /Chapter08/1.5.4.TrimEndTooFar.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.5.4.TrimEndTooFar.ps1 -------------------------------------------------------------------------------- /Chapter08/1.6.1.Insert.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.6.1.Insert.ps1 -------------------------------------------------------------------------------- /Chapter08/1.6.2.Remove.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.6.2.Remove.ps1 -------------------------------------------------------------------------------- /Chapter08/1.7.2.IndexOfAndIf.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.7.2.IndexOfAndIf.ps1 -------------------------------------------------------------------------------- /Chapter08/1.8.2.PadRight.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.8.2.PadRight.ps1 -------------------------------------------------------------------------------- /Chapter08/1.8.3.PadLeft.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.8.3.PadLeft.ps1 -------------------------------------------------------------------------------- /Chapter08/1.9.1.ToUpperAndToLower.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.9.1.ToUpperAndToLower.ps1 -------------------------------------------------------------------------------- /Chapter08/1.9.2.ToLowerAndReplace.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.9.2.ToLowerAndReplace.ps1 -------------------------------------------------------------------------------- /Chapter08/1.9.3.ToTitleCase.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/1.9.3.ToTitleCase.ps1 -------------------------------------------------------------------------------- /Chapter08/1.9.4.ToTitleCase_Alternative.ps1: -------------------------------------------------------------------------------- 1 | $host.CurrentCulture.TextInfo.ToTitleCase('another title') -------------------------------------------------------------------------------- /Chapter08/2.1.1.ToBase64String.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/2.1.1.ToBase64String.ps1 -------------------------------------------------------------------------------- /Chapter08/2.1.3.ToBase64String_CharArray.ps1: -------------------------------------------------------------------------------- 1 | [Convert]::ToBase64String('Hello world'.ToCharArray()) 2 | 3 | # Expects output: 4 | # 5 | # SGVsbG8gd29ybGQ= -------------------------------------------------------------------------------- /Chapter08/2.2.1.ConvertTo-Csv.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/2.2.1.ConvertTo-Csv.ps1 -------------------------------------------------------------------------------- /Chapter08/2.2.2.ConvertFrom-Csv.ps1: -------------------------------------------------------------------------------- 1 | "David,0123456789,28" | ConvertFrom-Csv -Header Name, Phone, Age -------------------------------------------------------------------------------- /Chapter08/2.2.4.ConvertFrom-Csv_FirstLineIsHeader.ps1: -------------------------------------------------------------------------------- 1 | 'Name,Age', 'David,28' | ConvertFrom-Csv -------------------------------------------------------------------------------- /Chapter08/2.3.1.Convert-String.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/2.3.1.Convert-String.ps1 -------------------------------------------------------------------------------- /Chapter08/3.1.1.ByteMultiplicationOperators.ps1: -------------------------------------------------------------------------------- 1 | 22.5GB 2 | 3 | # Expects output: 4 | # 5 | # 24159191040 -------------------------------------------------------------------------------- /Chapter08/3.2.1.PowerOf10Operator.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/3.2.1.PowerOf10Operator.ps1 -------------------------------------------------------------------------------- /Chapter08/3.2.2.Hexadecimal.ps1: -------------------------------------------------------------------------------- 1 | 0x5eb4 2 | 3 | # Expects output: 4 | # 5 | # 24244 6 | -------------------------------------------------------------------------------- /Chapter08/3.2.3.Math_RoundMethod.ps1: -------------------------------------------------------------------------------- 1 | [Math]::Round(2.123456789, 2) -------------------------------------------------------------------------------- /Chapter08/3.2.6.Math_Abs.ps1: -------------------------------------------------------------------------------- 1 | [Math]::Abs(-45748) -------------------------------------------------------------------------------- /Chapter08/3.2.7.Math_Pow.ps1: -------------------------------------------------------------------------------- 1 | [Math]::Pow(2, 8) # Returns 256 (28) -------------------------------------------------------------------------------- /Chapter08/3.2.8.Math_Sqrt.ps1: -------------------------------------------------------------------------------- 1 | [Math]::Sqrt(9) # Returns 3 -------------------------------------------------------------------------------- /Chapter08/3.2.9.Math_PiAndE.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/3.2.9.Math_PiAndE.ps1 -------------------------------------------------------------------------------- /Chapter08/4.0.1.Casting.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/4.0.1.Casting.ps1 -------------------------------------------------------------------------------- /Chapter08/4.0.3.Convert_ToInt32_FromHexadecimal.ps1: -------------------------------------------------------------------------------- 1 | [Convert]::ToInt32('FF9241', 16) # Returns 16749121 -------------------------------------------------------------------------------- /Chapter08/5.1.1.CastToDateTime.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/5.1.1.CastToDateTime.ps1 -------------------------------------------------------------------------------- /Chapter08/5.1.2.Test-DateTime.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/5.1.2.Test-DateTime.ps1 -------------------------------------------------------------------------------- /Chapter08/5.3.1.Get-Date_And_New-TImeSpan.ps1: -------------------------------------------------------------------------------- 1 | (Get-Date) + (New-Timespan -Hours 6) -------------------------------------------------------------------------------- /Chapter08/5.3.3.Get-Date_AddDays.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/5.3.3.Get-Date_AddDays.ps1 -------------------------------------------------------------------------------- /Chapter08/5.3.5.Get-Date_ToUniversalTime.ps1: -------------------------------------------------------------------------------- 1 | (Get-Date).ToUniversalTime() -------------------------------------------------------------------------------- /Chapter08/5.3.6.Get-Date_Kind.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/5.3.6.Get-Date_Kind.ps1 -------------------------------------------------------------------------------- /Chapter08/5.3.7.Get-Date_UtcKind.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/5.3.7.Get-Date_UtcKind.ps1 -------------------------------------------------------------------------------- /Chapter08/5.4.3.Get-Date_StoringDates.ps1: -------------------------------------------------------------------------------- 1 | (Get-Date).ToUniversalTime().ToString('u') -------------------------------------------------------------------------------- /Chapter08/5.5.1.ComparingDates.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter08/5.5.1.ComparingDates.ps1 -------------------------------------------------------------------------------- /Chapter09/1.1.1.FailingRegex.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/1.1.1.FailingRegex.ps1 -------------------------------------------------------------------------------- /Chapter09/1.2.1.SpecialCharacters.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/1.2.1.SpecialCharacters.ps1 -------------------------------------------------------------------------------- /Chapter09/1.2.2.matches.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/1.2.2.matches.ps1 -------------------------------------------------------------------------------- /Chapter09/1.3.1.AnyCharacter.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/1.3.1.AnyCharacter.ps1 -------------------------------------------------------------------------------- /Chapter09/1.5.1.EscapeCharacter.ps1: -------------------------------------------------------------------------------- 1 | '1 * 3' -match '\*' -------------------------------------------------------------------------------- /Chapter09/1.5.4.ValidButInvalid.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/1.5.4.ValidButInvalid.ps1 -------------------------------------------------------------------------------- /Chapter09/1.5.5.LiteralPeriod.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/1.5.5.LiteralPeriod.ps1 -------------------------------------------------------------------------------- /Chapter09/1.5.6.RemoveAllBeforeCharacter.ps1: -------------------------------------------------------------------------------- 1 | 'Domain\User' -replace '.+\\' # Everything up to and including \ -------------------------------------------------------------------------------- /Chapter09/2.1.0.StartOfString.ps1: -------------------------------------------------------------------------------- 1 | $env:PATH -split ';' | Where-Object { $_ -match '^C' } -------------------------------------------------------------------------------- /Chapter09/2.1.1.EndOfString.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/2.1.1.EndOfString.ps1 -------------------------------------------------------------------------------- /Chapter09/2.1.2.ReplaceTooMuch.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/2.1.2.ReplaceTooMuch.ps1 -------------------------------------------------------------------------------- /Chapter09/2.1.3.WordBoundary.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/2.1.3.WordBoundary.ps1 -------------------------------------------------------------------------------- /Chapter09/3.1.1.GreedyQuanifier.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/3.1.1.GreedyQuanifier.ps1 -------------------------------------------------------------------------------- /Chapter09/3.1.2.LazyQuanifier.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/3.1.2.LazyQuanifier.ps1 -------------------------------------------------------------------------------- /Chapter09/4.1.1.CharacterClasses.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/4.1.1.CharacterClasses.ps1 -------------------------------------------------------------------------------- /Chapter09/4.1.10.Range_LIteralHyphen_Escaped.ps1: -------------------------------------------------------------------------------- 1 | 'one-two_three,four' -split '[_\-,]' -------------------------------------------------------------------------------- /Chapter09/4.1.2.Range.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/4.1.2.Range.ps1 -------------------------------------------------------------------------------- /Chapter09/4.1.3.Range_IsASCII.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/4.1.3.Range_IsASCII.ps1 -------------------------------------------------------------------------------- /Chapter09/4.1.5.Range_HexadecimalNumber_CaseSensitive.ps1: -------------------------------------------------------------------------------- 1 | 'The registry value is 0xAF9B7' -cmatch '0x[0-9a-fA-F]+' -------------------------------------------------------------------------------- /Chapter09/4.1.9.Range_LIteralHyphen_Alternative.ps1: -------------------------------------------------------------------------------- 1 | 'one-two_three,four' -split '[_,-]' -------------------------------------------------------------------------------- /Chapter09/5.1.1.Alternation.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/5.1.1.Alternation.ps1 -------------------------------------------------------------------------------- /Chapter09/6.1.1.Repetition_Start.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/6.1.1.Repetition_Start.ps1 -------------------------------------------------------------------------------- /Chapter09/6.1.2.Repetition_Groups.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/6.1.2.Repetition_Groups.ps1 -------------------------------------------------------------------------------- /Chapter09/7.1.1.CaptureGroups.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/7.1.1.CaptureGroups.ps1 -------------------------------------------------------------------------------- /Chapter09/8.1.1.MatchMACAddress.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/8.1.1.MatchMACAddress.ps1 -------------------------------------------------------------------------------- /Chapter09/8.2.1.MatchIPAddress.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/8.2.1.MatchIPAddress.ps1 -------------------------------------------------------------------------------- /Chapter09/8.3.1.netstat_output.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/8.3.1.netstat_output.ps1 -------------------------------------------------------------------------------- /Chapter09/8.3.2.netstat_MatchTcp.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter09/8.3.2.netstat_MatchTcp.ps1 -------------------------------------------------------------------------------- /Chapter10/1.1.1_Set-Location.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/1.1.1_Set-Location.ps1 -------------------------------------------------------------------------------- /Chapter10/1.2.1_Get-Item.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/1.2.1_Get-Item.ps1 -------------------------------------------------------------------------------- /Chapter10/1.2.2_Get-Item_Error.ps1: -------------------------------------------------------------------------------- 1 | Get-Item $env:USERPROFILE\AppData -------------------------------------------------------------------------------- /Chapter10/1.2.3_Get-Item_Force.ps1: -------------------------------------------------------------------------------- 1 | Get-Item $env:USERPROFILE\AppData -Force -------------------------------------------------------------------------------- /Chapter10/1.3.1_New-PSDrive.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/1.3.1_New-PSDrive.ps1 -------------------------------------------------------------------------------- /Chapter10/2.1.1_Test-Path.ps1: -------------------------------------------------------------------------------- 1 | Test-Path HKLM:\Software\Publisher 2 | -------------------------------------------------------------------------------- /Chapter10/2.1.3_Test-Path_If.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/2.1.3_Test-Path_If.ps1 -------------------------------------------------------------------------------- /Chapter10/2.2.1_New-Item.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/2.2.1_New-Item.ps1 -------------------------------------------------------------------------------- /Chapter10/2.2.2_New-Item_ItemType.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/2.2.2_New-Item_ItemType.ps1 -------------------------------------------------------------------------------- /Chapter10/2.2.3_Remove-Item.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/2.2.3_Remove-Item.ps1 -------------------------------------------------------------------------------- /Chapter10/2.3.1_Invoke-Item.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/2.3.1_Invoke-Item.ps1 -------------------------------------------------------------------------------- /Chapter10/3.1.1_Set-ItemProperty.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/3.1.1_Set-ItemProperty.ps1 -------------------------------------------------------------------------------- /Chapter10/3.1.2_Get-Item_SetProperty.ps1: -------------------------------------------------------------------------------- 1 | (Get-Item 'somefile.txt').IsReadOnly = $true -------------------------------------------------------------------------------- /Chapter10/3.2.1_FileAttributes.ps1: -------------------------------------------------------------------------------- 1 | [System.IO.FileAttributes]3 -------------------------------------------------------------------------------- /Chapter10/3.2.2_FileAttribute_eq.ps1: -------------------------------------------------------------------------------- 1 | [System.IO.FileAttributes]'ReadOnly, Hidden' -eq 3 -------------------------------------------------------------------------------- /Chapter10/3.2.3_FileAttribute_replace.ps1: -------------------------------------------------------------------------------- 1 | (Get-Item 'somefile.txt').Attributes = 'ReadOnly, Hidden' -------------------------------------------------------------------------------- /Chapter10/3.2.5_FileAttribute_bor.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/3.2.5_FileAttribute_bor.ps1 -------------------------------------------------------------------------------- /Chapter10/4.1.1_Get-ItemProperty.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/4.1.1_Get-ItemProperty.ps1 -------------------------------------------------------------------------------- /Chapter10/4.1.2_Set-ItemProperty.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/4.1.2_Set-ItemProperty.ps1 -------------------------------------------------------------------------------- /Chapter10/4.1.3_Remove-ItemProperty.ps1: -------------------------------------------------------------------------------- 1 | Remove-ItemProperty -Path HKCU:\Environment -Name NewValue -------------------------------------------------------------------------------- /Chapter10/4.1.4_New-ItemProperty.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/4.1.4_New-ItemProperty.ps1 -------------------------------------------------------------------------------- /Chapter10/5.1.1_Setup.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.1.1_Setup.ps1 -------------------------------------------------------------------------------- /Chapter10/5.2.1_Get-Acl_Owner.ps1: -------------------------------------------------------------------------------- 1 | Get-Acl C:\Temp\ACL\1 | Select-Object Owner -------------------------------------------------------------------------------- /Chapter10/5.2.2_Set-Acl_Owner.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.2.2_Set-Acl_Owner.ps1 -------------------------------------------------------------------------------- /Chapter10/5.3.1_Get-Acl_Audit.ps1: -------------------------------------------------------------------------------- 1 | Get-Acl C:\Temp\ACL\1 -Audit | Format-List 2 | -------------------------------------------------------------------------------- /Chapter10/5.4.3_Get-Acl.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.4.3_Get-Acl.ps1 -------------------------------------------------------------------------------- /Chapter10/5.4.5_Get-Acl_Error.ps1: -------------------------------------------------------------------------------- 1 | Get-ChildItem C:\Temp\ACL\3 -------------------------------------------------------------------------------- /Chapter10/5.4.6_Set-Acl_Fix.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.4.6_Set-Acl_Fix.ps1 -------------------------------------------------------------------------------- /Chapter10/5.6.1_Set-Acl_Setup_1.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.6.1_Set-Acl_Setup_1.ps1 -------------------------------------------------------------------------------- /Chapter10/5.6.2_Set-Acl_Setup_2.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.6.2_Set-Acl_Setup_2.ps1 -------------------------------------------------------------------------------- /Chapter10/5.6.3_Get-Acl.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.6.3_Get-Acl.ps1 -------------------------------------------------------------------------------- /Chapter10/5.7.1_Setup.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.7.1_Setup.ps1 -------------------------------------------------------------------------------- /Chapter10/5.7.2_CopyAcl.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.7.2_CopyAcl.ps1 -------------------------------------------------------------------------------- /Chapter10/5.7.3_CopyAce.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.7.3_CopyAce.ps1 -------------------------------------------------------------------------------- /Chapter10/5.8.1_RightsEnum.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.8.1_RightsEnum.ps1 -------------------------------------------------------------------------------- /Chapter10/5.8.2_ShowRightsEnum.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.8.2_ShowRightsEnum.ps1 -------------------------------------------------------------------------------- /Chapter10/5.8.4_AddAccessRule.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.8.4_AddAccessRule.ps1 -------------------------------------------------------------------------------- /Chapter10/5.9.2_AddAccessRule.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/5.9.2_AddAccessRule.ps1 -------------------------------------------------------------------------------- /Chapter10/6.1.1_Get-PSProvider.ps1: -------------------------------------------------------------------------------- 1 | Get-PSProvider -------------------------------------------------------------------------------- /Chapter10/6.1.2_Start-Transaction.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/6.1.2_Start-Transaction.ps1 -------------------------------------------------------------------------------- /Chapter10/6.1.3_Undo-Transaction.ps1: -------------------------------------------------------------------------------- 1 | Undo-Transaction -------------------------------------------------------------------------------- /Chapter10/6.2.4_Complete-Transaction.ps1: -------------------------------------------------------------------------------- 1 | Complete-Transaction -------------------------------------------------------------------------------- /Chapter10/6.3.5_Get-Command_UseTransaction.ps1: -------------------------------------------------------------------------------- 1 | Get-Command -ParameterName UseTransaction -------------------------------------------------------------------------------- /Chapter10/7.1.1_New-FileCatalog.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/7.1.1_New-FileCatalog.ps1 -------------------------------------------------------------------------------- /Chapter10/7.2.1_Test-FileCatalog.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/7.2.1_Test-FileCatalog.ps1 -------------------------------------------------------------------------------- /Chapter10/7.2.2_Test-FileCatalog.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter10/7.2.2_Test-FileCatalog.ps1 -------------------------------------------------------------------------------- /Chapter11/2.1.1_WQL_SELECT.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/2.1.1_WQL_SELECT.ps1 -------------------------------------------------------------------------------- /Chapter11/2.1.2_WQL_SELECT_WHERE.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/2.1.2_WQL_SELECT_WHERE.ps1 -------------------------------------------------------------------------------- /Chapter11/2.1.3_WQL_Escape_characters.ps1: -------------------------------------------------------------------------------- 1 | Get-CimInstance Win32_Process -Filter "ExecutablePath='C:\\Windows\\Explorer.exe'" -------------------------------------------------------------------------------- /Chapter11/2.1.4_WQL_Wildcards.ps1: -------------------------------------------------------------------------------- 1 | Get-CimInstance Win32_Service -Filter 'PathName LIKE "_:\\%.exe"' -------------------------------------------------------------------------------- /Chapter11/2.1.5_Quoting_Outer_Single.ps1: -------------------------------------------------------------------------------- 1 | Get-CimInstance Win32_Process -Filter 'Name="powershell.exe"' -------------------------------------------------------------------------------- /Chapter11/2.1.6_Quoting_Outer_Double.ps1: -------------------------------------------------------------------------------- 1 | Get-CimInstance Win32_Process -Filter "Name='powershell.exe'" -------------------------------------------------------------------------------- /Chapter11/2.1.8_Composite_format.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/2.1.8_Composite_format.ps1 -------------------------------------------------------------------------------- /Chapter11/2.2.2_Wmi_object_path.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/2.2.2_Wmi_object_path.ps1 -------------------------------------------------------------------------------- /Chapter11/2.2.3_Wmi_accelerator.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/2.2.3_Wmi_accelerator.ps1 -------------------------------------------------------------------------------- /Chapter11/2.2.4_ASSOCIATORS_OF.ps1: -------------------------------------------------------------------------------- 1 | Get-CimInstance -Query "ASSOCIATORS OF {Win32_Process.Handle=$PID}" -------------------------------------------------------------------------------- /Chapter11/2.3.5_ASSOCIATORS_OF_ResultClass.ps1: -------------------------------------------------------------------------------- 1 | Get-CimInstance -Query "ASSOCIATORS OF {Win32_Process.Handle=$PID} WHERE ResultClass = CIM_DATAFILE" -------------------------------------------------------------------------------- /Chapter11/3.1.1_Get-CimInstance.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/3.1.1_Get-CimInstance.ps1 -------------------------------------------------------------------------------- /Chapter11/3.1.3_Get-CimInstance_Property.ps1: -------------------------------------------------------------------------------- 1 | Get-CimInstance Win32_UserAccount -Property Name, SID -------------------------------------------------------------------------------- /Chapter11/3.2.1_Get-CimClass.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/3.2.1_Get-CimClass.ps1 -------------------------------------------------------------------------------- /Chapter11/3.2.3_Get-CimNamespace.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/3.2.3_Get-CimNamespace.ps1 -------------------------------------------------------------------------------- /Chapter11/3.3.1_ClassMethods.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/3.3.1_ClassMethods.ps1 -------------------------------------------------------------------------------- /Chapter11/3.3.3_Invoke-CimMethod.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/3.3.3_Invoke-CimMethod.ps1 -------------------------------------------------------------------------------- /Chapter11/3.5.1_New-CimInstance.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/3.5.1_New-CimInstance.ps1 -------------------------------------------------------------------------------- /Chapter11/3.5.2_CimInstance_new.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/3.5.2_CimInstance_new.ps1 -------------------------------------------------------------------------------- /Chapter11/3.6.1_New-CimSession.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/3.6.1_New-CimSession.ps1 -------------------------------------------------------------------------------- /Chapter11/4.1.1_Wmi_and_WmiClass.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/4.1.1_Wmi_and_WmiClass.ps1 -------------------------------------------------------------------------------- /Chapter11/4.2.1_Get-WmiObject.ps1: -------------------------------------------------------------------------------- 1 | Get-WmiObject -Class Win32_ComputerSystem -------------------------------------------------------------------------------- /Chapter11/4.2.2_WmiSearcher.ps1: -------------------------------------------------------------------------------- 1 | ([WmiSearcher]"SELECT * FROM Win32_Process").Get() -------------------------------------------------------------------------------- /Chapter11/4.4.1_Get-WmiObject_Class.ps1: -------------------------------------------------------------------------------- 1 | Get-WmiObject Win32_Process -List -------------------------------------------------------------------------------- /Chapter11/4.4.2_Get-WmiObject_Class_Recurse.ps1: -------------------------------------------------------------------------------- 1 | Get-WmiObject -List -Recurse -------------------------------------------------------------------------------- /Chapter11/4.4.3_WmiClass.ps1: -------------------------------------------------------------------------------- 1 | [WmiClass]"Win32_Process" -------------------------------------------------------------------------------- /Chapter11/4.5.1_InstanceMethods.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/4.5.1_InstanceMethods.ps1 -------------------------------------------------------------------------------- /Chapter11/4.6.3_CreateShare.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/4.6.3_CreateShare.ps1 -------------------------------------------------------------------------------- /Chapter11/4.7.1_CreateInstance.ps1: -------------------------------------------------------------------------------- 1 | (Get-WmiObject Win32_Trustee -List).CreateInstance() -------------------------------------------------------------------------------- /Chapter11/4.8.1_AssociatedClasses.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/4.8.1_AssociatedClasses.ps1 -------------------------------------------------------------------------------- /Chapter11/5.1.10_Convert_DACL_ACE.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.1.10_Convert_DACL_ACE.ps1 -------------------------------------------------------------------------------- /Chapter11/5.1.11_CreateTrustee.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.1.11_CreateTrustee.ps1 -------------------------------------------------------------------------------- /Chapter11/5.1.12_CreateACE.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.1.12_CreateACE.ps1 -------------------------------------------------------------------------------- /Chapter11/5.1.13_AddToDACL.ps1: -------------------------------------------------------------------------------- 1 | $aclObject.DACL += $ace -------------------------------------------------------------------------------- /Chapter11/5.1.14_SetDescriptor.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.1.14_SetDescriptor.ps1 -------------------------------------------------------------------------------- /Chapter11/5.1.1_CreateShare.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.1.1_CreateShare.ps1 -------------------------------------------------------------------------------- /Chapter11/5.1.3_ShareSecurity.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.1.3_ShareSecurity.ps1 -------------------------------------------------------------------------------- /Chapter11/5.1.4_Descriptor.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.1.4_Descriptor.ps1 -------------------------------------------------------------------------------- /Chapter11/5.1.5_aclObject.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.1.5_aclObject.ps1 -------------------------------------------------------------------------------- /Chapter11/5.1.6_DACL.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.1.6_DACL.ps1 -------------------------------------------------------------------------------- /Chapter11/5.1.7_DACL_Trustee.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.1.7_DACL_Trustee.ps1 -------------------------------------------------------------------------------- /Chapter11/5.1.8_AceFlags.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.1.8_AceFlags.ps1 -------------------------------------------------------------------------------- /Chapter11/5.1.9_FileSystemRights.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.1.9_FileSystemRights.ps1 -------------------------------------------------------------------------------- /Chapter11/5.2.1_WmiPermissions.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.2.1_WmiPermissions.ps1 -------------------------------------------------------------------------------- /Chapter11/5.3.1_SDDL.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.3.1_SDDL.ps1 -------------------------------------------------------------------------------- /Chapter11/5.3.2_SetFromSDDL.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.3.2_SetFromSDDL.ps1 -------------------------------------------------------------------------------- /Chapter11/5.3.4_SDDLtoBackup.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.3.4_SDDLtoBackup.ps1 -------------------------------------------------------------------------------- /Chapter11/5.3.5_ViewSDDL.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.3.5_ViewSDDL.ps1 -------------------------------------------------------------------------------- /Chapter11/5.3.6_ImportSDDL.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.3.6_ImportSDDL.ps1 -------------------------------------------------------------------------------- /Chapter11/5.3.7_ViewDescriptor.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter11/5.3.7_ViewDescriptor.ps1 -------------------------------------------------------------------------------- /Chapter12/1.1.1_ConvertTo-Html.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/1.1.1_ConvertTo-Html.ps1 -------------------------------------------------------------------------------- /Chapter12/1.4.1_System.Web.ps1: -------------------------------------------------------------------------------- 1 | Add-Type -AssemblyName System.Web 2 | -------------------------------------------------------------------------------- /Chapter12/3.1.1_ExampleXml.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.1.1_ExampleXml.ps1 -------------------------------------------------------------------------------- /Chapter12/3.1.2_PropertyExpansion.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.1.2_PropertyExpansion.ps1 -------------------------------------------------------------------------------- /Chapter12/3.10.1_RemoveChild.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.10.1_RemoveChild.ps1 -------------------------------------------------------------------------------- /Chapter12/3.10.2_RemoveAttribute.ps1: -------------------------------------------------------------------------------- 1 | $xml.list.RemoveAttribute('type') -------------------------------------------------------------------------------- /Chapter12/3.11.1_ISEHelp.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.11.1_ISEHelp.ps1 -------------------------------------------------------------------------------- /Chapter12/3.11.2_SchemaValidation.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.11.2_SchemaValidation.ps1 -------------------------------------------------------------------------------- /Chapter12/3.2.1_ExampleXml.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.2.1_ExampleXml.ps1 -------------------------------------------------------------------------------- /Chapter12/3.2.2_Select-Xml.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.2.2_Select-Xml.ps1 -------------------------------------------------------------------------------- /Chapter12/3.2.3_SelectNodes.ps1: -------------------------------------------------------------------------------- 1 | ([Xml]$string).SelectNodes('//car[colour="Green"]/engine') -------------------------------------------------------------------------------- /Chapter12/3.3.1_Namespaces.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.3.1_Namespaces.ps1 -------------------------------------------------------------------------------- /Chapter12/3.6.1_XmlWriter.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.6.1_XmlWriter.ps1 -------------------------------------------------------------------------------- /Chapter12/3.7.1_ModifyingXml.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.7.1_ModifyingXml.ps1 -------------------------------------------------------------------------------- /Chapter12/3.7.2_ExampleXml.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.7.2_ExampleXml.ps1 -------------------------------------------------------------------------------- /Chapter12/3.7.3_SelectSingleNode_Set.ps1: -------------------------------------------------------------------------------- 1 | $xml.list.SelectSingleNode('./name[.="one"]').'#text' = 'three' -------------------------------------------------------------------------------- /Chapter12/3.8.1_NewElement.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.8.1_NewElement.ps1 -------------------------------------------------------------------------------- /Chapter12/3.9.1_ExampleXml.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.9.1_ExampleXml.ps1 -------------------------------------------------------------------------------- /Chapter12/3.9.2_ImportNode.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.9.2_ImportNode.ps1 -------------------------------------------------------------------------------- /Chapter12/3.9.3_OuterXml.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/3.9.3_OuterXml.ps1 -------------------------------------------------------------------------------- /Chapter12/4.1.1_Add-Type.ps1: -------------------------------------------------------------------------------- 1 | Add-Type -AssemblyName System.Xml.Linq -------------------------------------------------------------------------------- /Chapter12/4.1.2_using_assembly.ps1: -------------------------------------------------------------------------------- 1 | using assembly System.Xml.Linq -------------------------------------------------------------------------------- /Chapter12/4.2.1_ExampleXml.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/4.2.1_ExampleXml.ps1 -------------------------------------------------------------------------------- /Chapter12/4.2.2_Load.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/4.2.2_Load.ps1 -------------------------------------------------------------------------------- /Chapter12/4.3.1_SelectingNodes.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/4.3.1_SelectingNodes.ps1 -------------------------------------------------------------------------------- /Chapter12/4.3.2_UsingXPath.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/4.3.2_UsingXPath.ps1 -------------------------------------------------------------------------------- /Chapter12/4.4.1_CreateDocument.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/4.4.1_CreateDocument.ps1 -------------------------------------------------------------------------------- /Chapter12/4.4.2_ToString.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/4.4.2_ToString.ps1 -------------------------------------------------------------------------------- /Chapter12/4.4.3_Save.ps1: -------------------------------------------------------------------------------- 1 | $xDocument.Save("$pwd\test.xml") -------------------------------------------------------------------------------- /Chapter12/4.4.4_Get-Content.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/4.4.4_Get-Content.ps1 -------------------------------------------------------------------------------- /Chapter12/4.5.1_XNamespace.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/4.5.1_XNamespace.ps1 -------------------------------------------------------------------------------- /Chapter12/4.5.2_XNamespace_Shorthand.ps1: -------------------------------------------------------------------------------- 1 | [XNamespace]'http://example/cars' + 'engine' -------------------------------------------------------------------------------- /Chapter12/4.6.1_Modify_Element.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/4.6.1_Modify_Element.ps1 -------------------------------------------------------------------------------- /Chapter12/4.6.2_Modify_Attribute.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/4.6.2_Modify_Attribute.ps1 -------------------------------------------------------------------------------- /Chapter12/4.7.1_Add_element.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/4.7.1_Add_element.ps1 -------------------------------------------------------------------------------- /Chapter12/4.8.1_Remove_nodes.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/4.8.1_Remove_nodes.ps1 -------------------------------------------------------------------------------- /Chapter12/4.9.1_SchemaValidation.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/4.9.1_SchemaValidation.ps1 -------------------------------------------------------------------------------- /Chapter12/5.1.1_ConvertTo-Json.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/5.1.1_ConvertTo-Json.ps1 -------------------------------------------------------------------------------- /Chapter12/5.2.1_ConvertFrom-Json.ps1: -------------------------------------------------------------------------------- 1 | '{ "Property": "Value" }' | ConvertFrom-Json -------------------------------------------------------------------------------- /Chapter12/5.3.1_JSON_and_Get-Date.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/5.3.1_JSON_and_Get-Date.ps1 -------------------------------------------------------------------------------- /Chapter12/5.3.4_DateTime_type.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/5.3.4_DateTime_type.ps1 -------------------------------------------------------------------------------- /Chapter12/5.3.4_Remove-TypeData.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter12/5.3.4_Remove-TypeData.ps1 -------------------------------------------------------------------------------- /Chapter13/1.1.1_Invoke-WebRequest.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/1.1.1_Invoke-WebRequest.ps1 -------------------------------------------------------------------------------- /Chapter13/1.3.2_Invoke-WebRequest_InvalidCertificate_PSCore.ps1: -------------------------------------------------------------------------------- 1 | Invoke-WebRequest https://expired.badssl.com/ -SkipCertificateCheck -------------------------------------------------------------------------------- /Chapter13/1.4.1_CertificatePolicy.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/1.4.1_CertificatePolicy.ps1 -------------------------------------------------------------------------------- /Chapter13/1.5.2_TestSslConnection.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/1.5.2_TestSslConnection.ps1 -------------------------------------------------------------------------------- /Chapter13/1.5.3_Certificate.ps1: -------------------------------------------------------------------------------- 1 | $certValidation.Certificate -------------------------------------------------------------------------------- /Chapter13/1.5.4_Chain.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/1.5.4_Chain.ps1 -------------------------------------------------------------------------------- /Chapter13/1.5.5_ChainStatus.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/1.5.5_ChainStatus.ps1 -------------------------------------------------------------------------------- /Chapter13/1.6.2_SecurityProtocol.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/1.6.2_SecurityProtocol.ps1 -------------------------------------------------------------------------------- /Chapter13/2.1.1_Invoke-RestMethod.ps1: -------------------------------------------------------------------------------- 1 | Invoke-RestMethod -Uri https://api.github.com/users/powershell/repos -------------------------------------------------------------------------------- /Chapter13/2.1.1_ParseQueryString.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/2.1.1_ParseQueryString.ps1 -------------------------------------------------------------------------------- /Chapter13/2.2.2_HeaderValue.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/2.2.2_HeaderValue.ps1 -------------------------------------------------------------------------------- /Chapter13/2.3.10_UseToken.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/2.3.10_UseToken.ps1 -------------------------------------------------------------------------------- /Chapter13/2.3.4_OAUTH_Secrets.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/2.3.4_OAUTH_Secrets.ps1 -------------------------------------------------------------------------------- /Chapter13/2.3.6_WebViewWPFControl.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/2.3.6_WebViewWPFControl.ps1 -------------------------------------------------------------------------------- /Chapter13/2.3.7_BrowserControl.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/2.3.7_BrowserControl.ps1 -------------------------------------------------------------------------------- /Chapter13/2.3.8_GetAccessToken.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/2.3.8_GetAccessToken.ps1 -------------------------------------------------------------------------------- /Chapter13/3.2.1_Discover_methods.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/3.2.1_Discover_methods.ps1 -------------------------------------------------------------------------------- /Chapter13/3.2.3_Invoke_Methods.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/3.2.3_Invoke_Methods.ps1 -------------------------------------------------------------------------------- /Chapter13/3.2.4_SimpleArguments.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/3.2.4_SimpleArguments.ps1 -------------------------------------------------------------------------------- /Chapter13/3.2.5_Enum.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/3.2.5_Enum.ps1 -------------------------------------------------------------------------------- /Chapter13/3.2.6_GetEnumValues.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/3.2.6_GetEnumValues.ps1 -------------------------------------------------------------------------------- /Chapter13/3.2.8_ExplicitEnumValue.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/3.2.8_ExplicitEnumValue.ps1 -------------------------------------------------------------------------------- /Chapter13/3.3.1_ComplexArguments.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/3.3.1_ComplexArguments.ps1 -------------------------------------------------------------------------------- /Chapter13/3.3.2_CreateObject.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/3.3.2_CreateObject.ps1 -------------------------------------------------------------------------------- /Chapter13/3.3.4_MethodArguments.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/3.3.4_MethodArguments.ps1 -------------------------------------------------------------------------------- /Chapter13/3.4.2_BadTypeLookup.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/3.4.2_BadTypeLookup.ps1 -------------------------------------------------------------------------------- /Chapter13/3.4.3_FindingTheType.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter13/3.4.3_FindingTheType.ps1 -------------------------------------------------------------------------------- /Chapter13/3.4.4_NamespaceProperty.ps1: -------------------------------------------------------------------------------- 1 | ('{0}.SearchCondition' -f $service.GetType().Namespace -as [Type])::new() -------------------------------------------------------------------------------- /Chapter14/1.1.1_Disable-Remoting.ps1: -------------------------------------------------------------------------------- 1 | Disable-PSRemoting -------------------------------------------------------------------------------- /Chapter14/1.2.1_Get-WSManInstance.ps1: -------------------------------------------------------------------------------- 1 | Get-WSManInstance -ResourceUri wmicimv2/win32_operatingsystem 2 | -------------------------------------------------------------------------------- /Chapter14/1.3.1_Get-WSManInstance.ps1: -------------------------------------------------------------------------------- 1 | Set-Item WSMan:\localhost\MaxEnvelopeSizekb 1024 2 | -------------------------------------------------------------------------------- /Chapter14/1.3.2_Restart_winrm.ps1: -------------------------------------------------------------------------------- 1 | Restart-Service winrm 2 | -------------------------------------------------------------------------------- /Chapter14/1.4.2_CreateSSLListener.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/1.4.2_CreateSSLListener.ps1 -------------------------------------------------------------------------------- /Chapter14/1.4.3_OpenFirewall.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/1.4.3_OpenFirewall.ps1 -------------------------------------------------------------------------------- /Chapter14/1.4.4_Set-WSManQuickConfig.ps1: -------------------------------------------------------------------------------- 1 | Set-WSManQuickConfig -UseSSL -------------------------------------------------------------------------------- /Chapter14/1.4.5_ListListeners.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/1.4.5_ListListeners.ps1 -------------------------------------------------------------------------------- /Chapter14/1.4.7_UsingSSL.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/1.4.7_UsingSSL.ps1 -------------------------------------------------------------------------------- /Chapter14/1.4.8_SkipCACheck.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/1.4.8_SkipCACheck.ps1 -------------------------------------------------------------------------------- /Chapter14/1.4.9_Test-WSMan.ps1: -------------------------------------------------------------------------------- 1 | Test-WSMan -UseSSL -------------------------------------------------------------------------------- /Chapter14/1.5.1_Get-PSSessionConfiguration.ps1: -------------------------------------------------------------------------------- 1 | Get-PSSessionConfiguration Microsoft.PowerShell 2 | -------------------------------------------------------------------------------- /Chapter14/1.5.2_Set-PSSessionConfiguration_ShowSecurityDescriptorUI.ps1: -------------------------------------------------------------------------------- 1 | Set-PSSessionConfiguration Microsoft.PowerShell -ShowSecurityDescriptorUI 2 | -------------------------------------------------------------------------------- /Chapter14/1.5.3_ReadPermissions.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/1.5.3_ReadPermissions.ps1 -------------------------------------------------------------------------------- /Chapter14/1.5.4_ReadAndWrite.ps1: -------------------------------------------------------------------------------- 1 | $readAndWrite = -2147483648 -bor 1073741824 2 | -------------------------------------------------------------------------------- /Chapter14/1.5.6_SIDTranslate.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/1.5.6_SIDTranslate.ps1 -------------------------------------------------------------------------------- /Chapter14/1.5.7_AddAccess.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/1.5.7_AddAccess.ps1 -------------------------------------------------------------------------------- /Chapter14/1.5.8_SetAcl.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/1.5.8_SetAcl.ps1 -------------------------------------------------------------------------------- /Chapter14/1.7.1_GetTrustedHosts.ps1: -------------------------------------------------------------------------------- 1 | Get-Item WSMan:\localhost\Client\TrustedHosts -------------------------------------------------------------------------------- /Chapter14/1.7.2_Add-TrustedHost.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/1.7.2_Add-TrustedHost.ps1 -------------------------------------------------------------------------------- /Chapter14/2.1.1_New-PSSession.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/2.1.1_New-PSSession.ps1 -------------------------------------------------------------------------------- /Chapter14/2.2.1_Get-PSSession.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/2.2.1_Get-PSSession.ps1 -------------------------------------------------------------------------------- /Chapter14/2.2.2_SessionsAreGlobal.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/2.2.2_SessionsAreGlobal.ps1 -------------------------------------------------------------------------------- /Chapter14/2.3.10_Reconnect.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/2.3.10_Reconnect.ps1 -------------------------------------------------------------------------------- /Chapter14/2.3.11_SessionState.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/2.3.11_SessionState.ps1 -------------------------------------------------------------------------------- /Chapter14/2.3.12_UsingScope.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/2.3.12_UsingScope.ps1 -------------------------------------------------------------------------------- /Chapter14/2.3.1_Invoke-Command.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/2.3.1_Invoke-Command.ps1 -------------------------------------------------------------------------------- /Chapter14/2.3.5_AsJob.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/2.3.5_AsJob.ps1 -------------------------------------------------------------------------------- /Chapter14/2.4.1_Enter-PSSession.ps1: -------------------------------------------------------------------------------- 1 | Enter-PSSession PSTest -------------------------------------------------------------------------------- /Chapter14/2.5.1_Import-PSSession.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/2.5.1_Import-PSSession.ps1 -------------------------------------------------------------------------------- /Chapter14/2.6.1_Export-PSSession.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/2.6.1_Export-PSSession.ps1 -------------------------------------------------------------------------------- /Chapter14/2.6.2_Import-Module_ExportedSession.ps1: -------------------------------------------------------------------------------- 1 | Import-Module "NetAdapter-$computerName" -------------------------------------------------------------------------------- /Chapter14/3.1.1_ListShells.ps1: -------------------------------------------------------------------------------- 1 | # Run on Linux 2 | 3 | Get-Content /etc/shells # Use cat or less in Bash -------------------------------------------------------------------------------- /Chapter14/3.1.2_chsh.ps1: -------------------------------------------------------------------------------- 1 | # Run on Linux 2 | 3 | chsh -s /usr/bin/pwsh -------------------------------------------------------------------------------- /Chapter14/3.1.3_yum.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/3.1.3_yum.ps1 -------------------------------------------------------------------------------- /Chapter14/3.1.4_firewall-cmd.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/3.1.4_firewall-cmd.ps1 -------------------------------------------------------------------------------- /Chapter14/3.1.5_Enter-PSSession.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/3.1.5_Enter-PSSession.ps1 -------------------------------------------------------------------------------- /Chapter14/4.1.1_InstallOpenSSH.ps1: -------------------------------------------------------------------------------- 1 | # Run on Windows 2 | 3 | choco install openssh -------------------------------------------------------------------------------- /Chapter14/4.1.3_GetPublicKey.ps1: -------------------------------------------------------------------------------- 1 | # Run on Windows 2 | 3 | Get-Content ~\.ssh\id_rsa.pub | Set-Clipboard -------------------------------------------------------------------------------- /Chapter14/4.2.2_InstallSSHD.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/4.2.2_InstallSSHD.ps1 -------------------------------------------------------------------------------- /Chapter14/4.2.5_GetPublicKey.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/4.2.5_GetPublicKey.ps1 -------------------------------------------------------------------------------- /Chapter14/5.1.2_Enable-WSManCredSSP.ps1: -------------------------------------------------------------------------------- 1 | Enable-WSManCredSSP -Role Client -DelegateComputer PSTest 2 | -------------------------------------------------------------------------------- /Chapter14/5.1.3_Enable-WSManCredSSP_Server.ps1: -------------------------------------------------------------------------------- 1 | Enable-WSManCredSSP -Role Server -------------------------------------------------------------------------------- /Chapter14/5.1.4_Disable-WSManCredSSP_Client.ps1: -------------------------------------------------------------------------------- 1 | Disable-WSManCredSSP -Role Client -------------------------------------------------------------------------------- /Chapter14/5.1.5_Disable-WSManCredSSP_Server.ps1: -------------------------------------------------------------------------------- 1 | Disable-WSManCredSSP -Role Server -------------------------------------------------------------------------------- /Chapter14/6.1.1_CimSessionCommands.ps1: -------------------------------------------------------------------------------- 1 | Get-Command -ParameterName CimSession -------------------------------------------------------------------------------- /Chapter14/6.2.4_Get-CimSession.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/6.2.4_Get-CimSession.ps1 -------------------------------------------------------------------------------- /Chapter14/6.3.1_UsingCimSession.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter14/6.3.1_UsingCimSession.ps1 -------------------------------------------------------------------------------- /Chapter15/1.1.1.Start-Job.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/1.1.1.Start-Job.ps1 -------------------------------------------------------------------------------- /Chapter15/1.2.1.Receive-Job.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/1.2.1.Receive-Job.ps1 -------------------------------------------------------------------------------- /Chapter15/1.3.2.Wait-Job_Drain.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/1.3.2.Wait-Job_Drain.ps1 -------------------------------------------------------------------------------- /Chapter15/2.1.1.Get-Member.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/2.1.1.Get-Member.ps1 -------------------------------------------------------------------------------- /Chapter15/2.2.2.Get-Event.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/2.2.2.Get-Event.ps1 -------------------------------------------------------------------------------- /Chapter15/2.3.2.Unregister-Event.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/2.3.2.Unregister-Event.ps1 -------------------------------------------------------------------------------- /Chapter15/2.4.2.Raise_Event.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/2.4.2.Raise_Event.ps1 -------------------------------------------------------------------------------- /Chapter15/2.4.3.Cleanup.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/2.4.3.Cleanup.ps1 -------------------------------------------------------------------------------- /Chapter15/2.4.5.Raise_Event.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/2.4.5.Raise_Event.ps1 -------------------------------------------------------------------------------- /Chapter15/3.1.1.PowerShellInstance.ps1: -------------------------------------------------------------------------------- 1 | $psInstance = [PowerShell]::Create() -------------------------------------------------------------------------------- /Chapter15/3.1.2.AddCommand.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.1.2.AddCommand.ps1 -------------------------------------------------------------------------------- /Chapter15/3.1.3.AddStatement.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.1.3.AddStatement.ps1 -------------------------------------------------------------------------------- /Chapter15/3.1.4.Equivalent.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.1.4.Equivalent.ps1 -------------------------------------------------------------------------------- /Chapter15/3.1.5.AddScript.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.1.5.AddScript.ps1 -------------------------------------------------------------------------------- /Chapter15/3.2.1.BeginInvoke.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.2.1.BeginInvoke.ps1 -------------------------------------------------------------------------------- /Chapter15/3.2.3.IASyncInfo.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.2.3.IASyncInfo.ps1 -------------------------------------------------------------------------------- /Chapter15/3.2.4.OnCompletion.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.2.4.OnCompletion.ps1 -------------------------------------------------------------------------------- /Chapter15/3.2.5.OnCompletion.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.2.5.OnCompletion.ps1 -------------------------------------------------------------------------------- /Chapter15/3.2.6.OrphanedRunspace.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.2.6.OrphanedRunspace.ps1 -------------------------------------------------------------------------------- /Chapter15/3.2.8.Stop.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.2.8.Stop.ps1 -------------------------------------------------------------------------------- /Chapter15/3.3.1.EndInvoke.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.3.1.EndInvoke.ps1 -------------------------------------------------------------------------------- /Chapter15/3.4.1.MultipleInstances.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.4.1.MultipleInstances.ps1 -------------------------------------------------------------------------------- /Chapter15/3.4.3.Waiting.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.4.3.Waiting.ps1 -------------------------------------------------------------------------------- /Chapter15/3.5.2.RunspacePoolUsage.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.5.2.RunspacePoolUsage.ps1 -------------------------------------------------------------------------------- /Chapter15/3.5.5.RunspacePool_GC_Collect.ps1: -------------------------------------------------------------------------------- 1 | [GC]::Collect() -------------------------------------------------------------------------------- /Chapter15/3.6.4.ImportPSModule.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.6.4.ImportPSModule.ps1 -------------------------------------------------------------------------------- /Chapter15/3.6.6.ImportPSSnapIn.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.6.6.ImportPSSnapIn.ps1 -------------------------------------------------------------------------------- /Chapter15/3.7.2.SetMaxRunspaces.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.7.2.SetMaxRunspaces.ps1 -------------------------------------------------------------------------------- /Chapter15/3.8.4.ConcurrentStack.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter15/3.8.4.ConcurrentStack.ps1 -------------------------------------------------------------------------------- /Chapter16/1.1.1_Requires.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/1.1.1_Requires.ps1 -------------------------------------------------------------------------------- /Chapter16/1.1.2_about_Requires.ps1: -------------------------------------------------------------------------------- 1 | Get-Help about_Requires -------------------------------------------------------------------------------- /Chapter16/1.2.1_Using_recap.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/1.2.1_Using_recap.ps1 -------------------------------------------------------------------------------- /Chapter16/1.3.1_Nested_Functions.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/1.3.1_Nested_Functions.ps1 -------------------------------------------------------------------------------- /Chapter16/1.4.1_about_comment_based_help.ps1: -------------------------------------------------------------------------------- 1 | Get-Help about_Comment_Based_Help -------------------------------------------------------------------------------- /Chapter16/1.4.2_CBH_script.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/1.4.2_CBH_script.ps1 -------------------------------------------------------------------------------- /Chapter16/1.4.3_CBH_function.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/1.4.3_CBH_function.ps1 -------------------------------------------------------------------------------- /Chapter16/1.4.4_CBH_parameter.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/1.4.4_CBH_parameter.ps1 -------------------------------------------------------------------------------- /Chapter16/1.4.7_CBH_example.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/1.4.7_CBH_example.ps1 -------------------------------------------------------------------------------- /Chapter16/1.5.1_line_break_on_pipe.ps1: -------------------------------------------------------------------------------- 1 | Get-Process | 2 | Where-Object Name -match 'po?w(er)?sh(ell)?' -------------------------------------------------------------------------------- /Chapter16/1.5.2_short_pipeline.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/1.5.2_short_pipeline.ps1 -------------------------------------------------------------------------------- /Chapter16/2.3.1_Show-Pipeline_end.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/2.3.1_Show-Pipeline_end.ps1 -------------------------------------------------------------------------------- /Chapter16/2.3.3_Measure-Item.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/2.3.3_Measure-Item.ps1 -------------------------------------------------------------------------------- /Chapter16/2.4.1_Invoke-Return.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/2.4.1_Invoke-Return.ps1 -------------------------------------------------------------------------------- /Chapter16/2.5.1_StringBuilder.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/2.5.1_StringBuilder.ps1 -------------------------------------------------------------------------------- /Chapter16/2.5.2_Demo_function.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/2.5.2_Demo_function.ps1 -------------------------------------------------------------------------------- /Chapter16/2.5.3_Unintended_output.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/2.5.3_Unintended_output.ps1 -------------------------------------------------------------------------------- /Chapter16/2.5.4_Out-Null.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/2.5.4_Out-Null.ps1 -------------------------------------------------------------------------------- /Chapter16/2.5.5_Assign_to_null.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/2.5.5_Assign_to_null.ps1 -------------------------------------------------------------------------------- /Chapter16/2.5.6_Redirect_to_null.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/2.5.6_Redirect_to_null.ps1 -------------------------------------------------------------------------------- /Chapter16/2.5.7_Cast_to_Void.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/2.5.7_Cast_to_Void.ps1 -------------------------------------------------------------------------------- /Chapter16/3.1.1_param.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/3.1.1_param.ps1 -------------------------------------------------------------------------------- /Chapter16/3.2.1_param_type.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/3.2.1_param_type.ps1 -------------------------------------------------------------------------------- /Chapter16/3.2.2_param_nullable.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/3.2.2_param_nullable.ps1 -------------------------------------------------------------------------------- /Chapter16/3.2.3_Test-Nullable.ps1: -------------------------------------------------------------------------------- 1 | Test-Nullable -Date $null 2 | 3 | # Expected to not throw -------------------------------------------------------------------------------- /Chapter16/3.3.1_Default_value.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/3.3.1_Default_value.ps1 -------------------------------------------------------------------------------- /Chapter16/3.4.1_Cross_referencing.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/3.4.1_Cross_referencing.ps1 -------------------------------------------------------------------------------- /Chapter16/3.5.2_about_CommonParameters.ps1: -------------------------------------------------------------------------------- 1 | Get-Help about_commonparameters -------------------------------------------------------------------------------- /Chapter16/3.5.3_Show-Verbose.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/3.5.3_Show-Verbose.ps1 -------------------------------------------------------------------------------- /Chapter16/3.5.4_CmdletBinding.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/3.5.4_CmdletBinding.ps1 -------------------------------------------------------------------------------- /Chapter16/4.1.2_WhatIf_running.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/4.1.2_WhatIf_running.ps1 -------------------------------------------------------------------------------- /Chapter16/4.1.4_WhatIf_running.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/4.1.4_WhatIf_running.ps1 -------------------------------------------------------------------------------- /Chapter16/4.1.5_ShouldProcess_All.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/4.1.5_ShouldProcess_All.ps1 -------------------------------------------------------------------------------- /Chapter16/4.1.6_Confirm_running.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/4.1.6_Confirm_running.ps1 -------------------------------------------------------------------------------- /Chapter16/4.2.1_ShouldContinue.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter16/4.2.1_ShouldContinue.ps1 -------------------------------------------------------------------------------- /Chapter17/1.2.1.PositionalBinding.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/1.2.1.PositionalBinding.ps1 -------------------------------------------------------------------------------- /Chapter17/1.2.2.PositionalBinding.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/1.2.2.PositionalBinding.ps1 -------------------------------------------------------------------------------- /Chapter17/1.3.1.DontShow.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/1.3.1.DontShow.ps1 -------------------------------------------------------------------------------- /Chapter17/1.5.1.HelpMessage.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/1.5.1.HelpMessage.ps1 -------------------------------------------------------------------------------- /Chapter17/2.2.1.Exploration.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/2.2.1.Exploration.ps1 -------------------------------------------------------------------------------- /Chapter17/2.2.11.ValidatePattern_Options_Multiple.ps1: -------------------------------------------------------------------------------- 1 | [ValidatePattern('^Hello', Options = 'IgnoreCase, Multiline')] -------------------------------------------------------------------------------- /Chapter17/2.2.12.ValidatePattern_Options_CaseSensitive.ps1: -------------------------------------------------------------------------------- 1 | [ValidatePattern('^Hello', Options = 'None')] -------------------------------------------------------------------------------- /Chapter17/2.2.15.ValidateRange.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/2.2.15.ValidateRange.ps1 -------------------------------------------------------------------------------- /Chapter17/2.2.16.ValidateScript.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/2.2.16.ValidateScript.ps1 -------------------------------------------------------------------------------- /Chapter17/2.2.19.ValidateSet.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/2.2.19.ValidateSet.ps1 -------------------------------------------------------------------------------- /Chapter17/2.2.2.ValidateNotNull.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/2.2.2.ValidateNotNull.ps1 -------------------------------------------------------------------------------- /Chapter17/2.2.6.ValidateCount.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/2.2.6.ValidateCount.ps1 -------------------------------------------------------------------------------- /Chapter17/2.2.7.ValidateDrive.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/2.2.7.ValidateDrive.ps1 -------------------------------------------------------------------------------- /Chapter17/2.2.8.ValidateLength.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/2.2.8.ValidateLength.ps1 -------------------------------------------------------------------------------- /Chapter17/2.2.9.ValidatePattern.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/2.2.9.ValidatePattern.ps1 -------------------------------------------------------------------------------- /Chapter17/2.3.1.AllowNull.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/2.3.1.AllowNull.ps1 -------------------------------------------------------------------------------- /Chapter17/2.3.2.AllowEmptyString.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/2.3.2.AllowEmptyString.ps1 -------------------------------------------------------------------------------- /Chapter17/2.3.4.AllowEmptyCollection_Demo.ps1: -------------------------------------------------------------------------------- 1 | Test-AllowEmptyCollection -Parameter1 @() -------------------------------------------------------------------------------- /Chapter17/2.4.1.PSReference.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/2.4.1.PSReference.ps1 -------------------------------------------------------------------------------- /Chapter17/3.1.1.ValueFromPipeine.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/3.1.1.ValueFromPipeine.ps1 -------------------------------------------------------------------------------- /Chapter17/3.1.9.ValueFromPipeine_MutlipleParams_Trace-Command.ps1: -------------------------------------------------------------------------------- 1 | Trace-Command -Expression { 1 | Test-ValueFromPipeline } -PSHost -Name ParameterBinding 2 | -------------------------------------------------------------------------------- /Chapter17/4.1.1.ParameterSets.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/4.1.1.ParameterSets.ps1 -------------------------------------------------------------------------------- /Chapter17/4.1.6.AllParameterSets.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/4.1.6.AllParameterSets.ps1 -------------------------------------------------------------------------------- /Chapter17/6.1.1.dynamicparam.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter17/6.1.1.dynamicparam.ps1 -------------------------------------------------------------------------------- /Chapter18/1.1.1.enum.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/1.1.1.enum.ps1 -------------------------------------------------------------------------------- /Chapter18/1.2.2.enum_CastToInt.ps1: -------------------------------------------------------------------------------- 1 | [Int][MyEnum]::First -------------------------------------------------------------------------------- /Chapter18/1.2.3.enum_NewToPS62.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/1.2.3.enum_NewToPS62.ps1 -------------------------------------------------------------------------------- /Chapter18/1.3.1.enum_no_value.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/1.3.1.enum_no_value.ps1 -------------------------------------------------------------------------------- /Chapter18/1.3.2.enum_sequencing.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/1.3.2.enum_sequencing.ps1 -------------------------------------------------------------------------------- /Chapter18/1.4.2.enum_cast_to_Boolean.ps1: -------------------------------------------------------------------------------- 1 | [Boolean][Ensure]::Absent -------------------------------------------------------------------------------- /Chapter18/1.5.1.enum_flags.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/1.5.1.enum_flags.ps1 -------------------------------------------------------------------------------- /Chapter18/1.5.2.enum_flags_casting_string.ps1: -------------------------------------------------------------------------------- 1 | [Int][MyEnum]'First,Second' -------------------------------------------------------------------------------- /Chapter18/1.5.3.enum_flags_casting_int.ps1: -------------------------------------------------------------------------------- 1 | [MyEnum]6 2 | 3 | # Expects output: 4 | # 5 | # Second, Third -------------------------------------------------------------------------------- /Chapter18/1.6.1.enum_union.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/1.6.1.enum_union.ps1 -------------------------------------------------------------------------------- /Chapter18/1.6.2.enum_union_demo.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/1.6.2.enum_union_demo.ps1 -------------------------------------------------------------------------------- /Chapter18/2.1.1.class.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/2.1.1.class.ps1 -------------------------------------------------------------------------------- /Chapter18/2.1.2.class_new.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/2.1.2.class_new.ps1 -------------------------------------------------------------------------------- /Chapter18/2.2.1.properties.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/2.2.1.properties.ps1 -------------------------------------------------------------------------------- /Chapter18/2.4.1.methods.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/2.4.1.methods.ps1 -------------------------------------------------------------------------------- /Chapter18/2.4.2.overloaded.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/2.4.2.overloaded.ps1 -------------------------------------------------------------------------------- /Chapter18/2.5.1.inheritance.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/2.5.1.inheritance.ps1 -------------------------------------------------------------------------------- /Chapter18/2.5.2.inherited_members.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/2.5.2.inherited_members.ps1 -------------------------------------------------------------------------------- /Chapter18/2.6.1.hidden.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/2.6.1.hidden.ps1 -------------------------------------------------------------------------------- /Chapter18/2.6.2.hidden_Get-Member.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/2.6.2.hidden_Get-Member.ps1 -------------------------------------------------------------------------------- /Chapter18/2.7.1.static.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/2.7.1.static.ps1 -------------------------------------------------------------------------------- /Chapter18/2.7.2.static_invocation.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/2.7.2.static_invocation.ps1 -------------------------------------------------------------------------------- /Chapter18/5.1.1.DscFramework.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter18/5.1.1.DscFramework.ps1 -------------------------------------------------------------------------------- /Chapter19/1.1.1.LocalMachine_v1.psm1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter19/1.1.1.LocalMachine_v1.psm1 -------------------------------------------------------------------------------- /Chapter19/1.2.2.Export-ModuleMember_wildcards.ps1: -------------------------------------------------------------------------------- 1 | Export-ModuleMember -Function *-ComputerDescription 2 | -------------------------------------------------------------------------------- /Chapter19/1.3.3.Update-Metadata.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter19/1.3.3.Update-Metadata.ps1 -------------------------------------------------------------------------------- /Chapter19/2.2.1.ModuleBuilder.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter19/2.2.1.ModuleBuilder.ps1 -------------------------------------------------------------------------------- /Chapter19/2.2.3.SimpleBuildScript.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter19/2.2.3.SimpleBuildScript.ps1 -------------------------------------------------------------------------------- /Chapter19/3.2.1.ModuleService.psm1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter19/3.2.1.ModuleService.psm1 -------------------------------------------------------------------------------- /Chapter19/4.2.1.TestOnRemove.psm1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter19/4.2.1.TestOnRemove.psm1 -------------------------------------------------------------------------------- /Chapter19/4.2.3.Remove-Module.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter19/4.2.3.Remove-Module.ps1 -------------------------------------------------------------------------------- /Chapter20/1.1.1_Ast.ps1: -------------------------------------------------------------------------------- 1 | { Write-Host 'content' }.Ast -------------------------------------------------------------------------------- /Chapter20/1.1.2_Ast_ScriptBlock.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/1.1.2_Ast_ScriptBlock.ps1 -------------------------------------------------------------------------------- /Chapter20/1.1.4_Get-Item.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/1.1.4_Get-Item.ps1 -------------------------------------------------------------------------------- /Chapter20/1.1.5_Tree_Walk.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/1.1.5_Tree_Walk.ps1 -------------------------------------------------------------------------------- /Chapter20/1.1.6_FindAll.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/1.1.6_FindAll.ps1 -------------------------------------------------------------------------------- /Chapter20/1.2.1_Tokenize_PS2.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/1.2.1_Tokenize_PS2.ps1 -------------------------------------------------------------------------------- /Chapter20/1.2.2_ParseInput_PS3.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/1.2.2_ParseInput_PS3.ps1 -------------------------------------------------------------------------------- /Chapter20/1.3.1_PSScriptAnalyzer.ps1: -------------------------------------------------------------------------------- 1 | Install-Module PSScriptAnalyzer -Scope CurrentUser -------------------------------------------------------------------------------- /Chapter20/1.3.2_Show-Password.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/1.3.2_Show-Password.ps1 -------------------------------------------------------------------------------- /Chapter20/1.3.3_Invoke-ScriptAnalyzer.ps1: -------------------------------------------------------------------------------- 1 | Invoke-ScriptAnalyzer .\Show-Password.ps1 | Format-List -------------------------------------------------------------------------------- /Chapter20/1.4.1_New-Message.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/1.4.1_New-Message.ps1 -------------------------------------------------------------------------------- /Chapter20/1.4.3_SuppressMessage.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/1.4.3_SuppressMessage.ps1 -------------------------------------------------------------------------------- /Chapter20/1.5.3_DemoFunction.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/1.5.3_DemoFunction.ps1 -------------------------------------------------------------------------------- /Chapter20/2.1.1_Get-SquareRoot.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.1.1_Get-SquareRoot.ps1 -------------------------------------------------------------------------------- /Chapter20/2.10.11_DemoFunction.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.10.11_DemoFunction.ps1 -------------------------------------------------------------------------------- /Chapter20/2.10.13_Set-NetAdapter.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.10.13_Set-NetAdapter.ps1 -------------------------------------------------------------------------------- /Chapter20/2.10.16_New-CimInstance_WithoutNamespace.ps1: -------------------------------------------------------------------------------- 1 | New-CimInstance MSFT_NetAdapter -ClientOnly -------------------------------------------------------------------------------- /Chapter20/2.10.1_SimpleObject.ps1: -------------------------------------------------------------------------------- 1 | [PSCustomObject]@{ 2 | Property = "Value" 3 | } -------------------------------------------------------------------------------- /Chapter20/2.10.2_SimpleMethod.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.10.2_SimpleMethod.ps1 -------------------------------------------------------------------------------- /Chapter20/2.10.3_DemoFunction.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.10.3_DemoFunction.ps1 -------------------------------------------------------------------------------- /Chapter20/2.10.4_BasicMocks.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.10.4_BasicMocks.ps1 -------------------------------------------------------------------------------- /Chapter20/2.10.5_Describe.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.10.5_Describe.ps1 -------------------------------------------------------------------------------- /Chapter20/2.10.6_ReplaceMember.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.10.6_ReplaceMember.ps1 -------------------------------------------------------------------------------- /Chapter20/2.10.7_BaseMember.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.10.7_BaseMember.ps1 -------------------------------------------------------------------------------- /Chapter20/2.10.8_DemoFunction.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.10.8_DemoFunction.ps1 -------------------------------------------------------------------------------- /Chapter20/2.11.1_DemoFunction.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.11.1_DemoFunction.ps1 -------------------------------------------------------------------------------- /Chapter20/2.11.2_Mocks.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.11.2_Mocks.ps1 -------------------------------------------------------------------------------- /Chapter20/2.11.3_DescriptionBlank.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.11.3_DescriptionBlank.ps1 -------------------------------------------------------------------------------- /Chapter20/2.11.4_DescriptionSet.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.11.4_DescriptionSet.ps1 -------------------------------------------------------------------------------- /Chapter20/2.11.5_ErrorHandling.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.11.5_ErrorHandling.ps1 -------------------------------------------------------------------------------- /Chapter20/2.11.6_Combined.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.11.6_Combined.ps1 -------------------------------------------------------------------------------- /Chapter20/2.2.1_TestCases.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.2.1_TestCases.ps1 -------------------------------------------------------------------------------- /Chapter20/2.4.1_ShouldThrow.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.4.1_ShouldThrow.ps1 -------------------------------------------------------------------------------- /Chapter20/2.6.1_DemoFunction.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.6.1_DemoFunction.ps1 -------------------------------------------------------------------------------- /Chapter20/2.6.2_BeforeAll.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.6.2_BeforeAll.ps1 -------------------------------------------------------------------------------- /Chapter20/2.6.3_AfterAll.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.6.3_AfterAll.ps1 -------------------------------------------------------------------------------- /Chapter20/2.6.4_BeforeEach.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.6.4_BeforeEach.ps1 -------------------------------------------------------------------------------- /Chapter20/2.6.5_It.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.6.5_It.ps1 -------------------------------------------------------------------------------- /Chapter20/2.6.6_All.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.6.6_All.ps1 -------------------------------------------------------------------------------- /Chapter20/2.7.2_TestDrive_AfterAll.ps1: -------------------------------------------------------------------------------- 1 | AfterAll { 2 | Pop-Location 3 | } -------------------------------------------------------------------------------- /Chapter20/2.8.1_Mock.ps1: -------------------------------------------------------------------------------- 1 | Describe Subject { 2 | Mock Get-Date 3 | } -------------------------------------------------------------------------------- /Chapter20/2.8.2_Mock_MockWith.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.8.2_Mock_MockWith.ps1 -------------------------------------------------------------------------------- /Chapter20/2.9.10_DemoFunction.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.9.10_DemoFunction.ps1 -------------------------------------------------------------------------------- /Chapter20/2.9.12_GetParamBlock.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.9.12_GetParamBlock.ps1 -------------------------------------------------------------------------------- /Chapter20/2.9.4_DemoFunction.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter20/2.9.4_DemoFunction.ps1 -------------------------------------------------------------------------------- /Chapter20/2.9.6_Assert-MockCalled_Times_0.ps1: -------------------------------------------------------------------------------- 1 | Assert-MockCalled Get-CimInstance -Times 0 -------------------------------------------------------------------------------- /Chapter20/2.9.7_Assert-MockCalled_Times_Exactly.ps1: -------------------------------------------------------------------------------- 1 | Assert-MockCalled Get-CimInstance -Times 1 -Exactly -------------------------------------------------------------------------------- /Chapter21/2.1.2_ErrorVariable.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter21/2.1.2_ErrorVariable.ps1 -------------------------------------------------------------------------------- /Chapter21/3.1.1_ErrorRecord.ps1: -------------------------------------------------------------------------------- 1 | 100 / 0 2 | $record = $Error[0] -------------------------------------------------------------------------------- /Chapter21/3.1.3_StackTrace.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter21/3.1.3_StackTrace.ps1 -------------------------------------------------------------------------------- /Chapter21/3.1.4_TargetObject.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter21/3.1.4_TargetObject.ps1 -------------------------------------------------------------------------------- /Chapter21/3.2.1_Write-Error_Message.ps1: -------------------------------------------------------------------------------- 1 | Write-Error 'Message' -------------------------------------------------------------------------------- /Chapter21/3.4.1_throw.ps1: -------------------------------------------------------------------------------- 1 | throw 'Error message' -------------------------------------------------------------------------------- /Chapter21/3.5.1_throw_ExceptionType.ps1: -------------------------------------------------------------------------------- 1 | throw 'Error message' -------------------------------------------------------------------------------- /Chapter21/3.5.2_throw_ArgumentException.ps1: -------------------------------------------------------------------------------- 1 | throw [ArgumentException]::new('Unsupported value') -------------------------------------------------------------------------------- /Chapter21/3.6.1_BuiltInErrorVariable.ps1: -------------------------------------------------------------------------------- 1 | $Error.Clear() -------------------------------------------------------------------------------- /Chapter21/3.6.2_BuiltInErrorVariable_Index.ps1: -------------------------------------------------------------------------------- 1 | $Error[0] -------------------------------------------------------------------------------- /Chapter21/4.1.1_TryCatch.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter21/4.1.1_TryCatch.ps1 -------------------------------------------------------------------------------- /Chapter21/4.1.6_Finally.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter21/4.1.6_Finally.ps1 -------------------------------------------------------------------------------- /Chapter21/4.2.1_Re-throw.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter21/4.2.1_Re-throw.ps1 -------------------------------------------------------------------------------- /Chapter21/5.2.1_DemoFunction.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter21/5.2.1_DemoFunction.ps1 -------------------------------------------------------------------------------- /Chapter21/5.2.4_WithTryCatch.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter21/5.2.4_WithTryCatch.ps1 -------------------------------------------------------------------------------- /Chapter21/5.3.1_Connect-Server.ps1: -------------------------------------------------------------------------------- 1 | function Connect-Server {} -------------------------------------------------------------------------------- /Chapter21/5.3.4_NestedTryCatch.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter21/5.3.4_NestedTryCatch.ps1 -------------------------------------------------------------------------------- /Chapter21/5.5.1_Trap.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter21/5.5.1_Trap.ps1 -------------------------------------------------------------------------------- /Chapter21/5.5.4_Trap_Scope.ps1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/Chapter21/5.5.4_Trap_Scope.ps1 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Mastering-Windows-PowerShell-Scripting-Third-Edition/HEAD/README.md --------------------------------------------------------------------------------