Example: confidence

PowerShell - Learn programming languages with books and ...

PowerShell #powershellTable of ContentsAbout1 Chapter 1: Getting started with PowerShell2 Remarks2 Versions2 Examples2 Installation or Setup2 Windows2 Other Platforms3 Allow scripts stored on your machine to run un-signed3 Aliases & Similar Functions4 The Pipeline - Using Output from a PowerShell cmdlet5 Commenting6 Calling .Net Library Methods6 Creating Objects7 Chapter 2: ActiveDirectory module9 Introduction9 Remarks9 Examples9 Module9 Users9 Groups10 Computers10 Objects10 Chapter 3: Aliases12 Remarks12 Examples13 Get-Alias13 Set-Alias13 Chapter 4: Amazon Web Services (AWS) Rekognition15 Introduction15 Examples15 Detect Image Labels with AWS Rekognition15 Compare Facial Similarity with AWS Rekognition16 Chapter 5: Amazon Web Services (AWS) Simple Storage Service (S3)17 Introduction17 Parameters17 Examples17 Create a new S3 Bucket17 Upload a Local File Into an S3 Bucket17 Delete a S3 Bucket18 Chapter 6.

For 80 Foreach 80 While 81 ForEach-Object 81 Basic usage 82 Advanced usage 82 Do 83 ForEach() Method 83 Continue 84 Break 84 Chapter 34: Modules, Scripts and Functions 86

Tags:

  Programming, Powershell

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of PowerShell - Learn programming languages with books and ...

1 PowerShell #powershellTable of ContentsAbout1 Chapter 1: Getting started with PowerShell2 Remarks2 Versions2 Examples2 Installation or Setup2 Windows2 Other Platforms3 Allow scripts stored on your machine to run un-signed3 Aliases & Similar Functions4 The Pipeline - Using Output from a PowerShell cmdlet5 Commenting6 Calling .Net Library Methods6 Creating Objects7 Chapter 2: ActiveDirectory module9 Introduction9 Remarks9 Examples9 Module9 Users9 Groups10 Computers10 Objects10 Chapter 3: Aliases12 Remarks12 Examples13 Get-Alias13 Set-Alias13 Chapter 4: Amazon Web Services (AWS) Rekognition15 Introduction15 Examples15 Detect Image Labels with AWS Rekognition15 Compare Facial Similarity with AWS Rekognition16 Chapter 5: Amazon Web Services (AWS) Simple Storage Service (S3)17 Introduction17 Parameters17 Examples17 Create a new S3 Bucket17 Upload a Local File Into an S3 Bucket17 Delete a S3 Bucket18 Chapter 6.

2 Anonymize IP (v4 and v6) in text file with Powershell19 Introduction19 Examples19 Anonymize IP address in text file19 Chapter 7: Archive Module21 Introduction21 Syntax21 Parameters21 Remarks21 Examples22 Compress-Archive with wildcard22 Update existing ZIP with Compress-Archive22 Extract a Zip with Expand-Archive22 Chapter 8: Automatic Variables23 Introduction23 Syntax23 Examples23$pid23 Boolean values23$null23$OFS24$_ / $PSItem24$?25$error25 Chapter 9: Automatic Variables - part 226 Introduction26 Remarks26 Examples26$PSVersionTable26 Chapter 10: Basic Set Operations27 Introduction27 Syntax27 Examples27 Filtering: Where-Object / where / ?27 Ordering: Sort-Object / sort28 Grouping: Group-Object / group29 Projecting: Select-Object / select29 Chapter 11: Built-in variables32 Introduction32 Examples32$PSScriptRoot32$Args32$PSItem3 2$?

3 33$error33 Chapter 12: Calculated Properties34 Introduction34 Examples34 Display file size in KB - Calculated Properties34 Chapter 13: Cmdlet Naming35 Introduction35 Examples35 Verbs35 Nouns35 Chapter 14: Comment-based help36 Introduction36 Examples36 Function comment-based help36 Script comment-based help38 Chapter 15: Common parameters41 Remarks41 Examples41 ErrorAction parameter41-ErrorAction Continue41-ErrorAction Ignore41-ErrorAction Inquire42-ErrorAction SilentlyContinue42-ErrorAction Stop42-ErrorAction Suspend43 Chapter 16: Communicating with RESTful APIs44 Introduction44 Examples44 Use Incoming Webhooks44 Post Message to hipChat44 Using REST with PowerShell Objects to Get and Put individual data44 Using REST with PowerShell Objects to GET and POST many items45 Using REST with PowerShell to Delete items45 Chapter 17: Conditional logic46 Syntax46 Remarks46 Examples46if, else and else if46 Negation47If conditional shorthand47 Chapter 18: Creating DSC Class-Based Resources49 Introduction49 Remarks49 Examples49 Create a DSC Resource Skeleton Class49 DSC Resource Skeleton with Key Property49 DSC Resource with Mandatory Property50 DSC Resource with Required Methods50 Chapter 19.

4 CSV parsing52 Examples52 Basic usage of Import-Csv52 Import from CSV and cast properties to correct type52 Chapter 20: Desired State Configuration54 Examples54 Simple example - Enabling WindowsFeature54 Starting DSC (mof) on remote machine54 Importing psd1 (data file) into local variable54 List available DSC Resources55 Importing resources for use in DSC55 Chapter 21: Embedding Managed Code (C# | VB)56 Introduction56 Parameters56 Remarks56 Removing Added types56 CSharp and .NET syntax56 Examples57C# Example57 Chapter 22: Enforcing script prerequisites59 Syntax59 Remarks59 Examples59 Enforce minimum version of PowerShell host59 Enforce running the script as admininstrator59 Chapter 23: Environment Variables61 Examples61 Windows environment variables are visible as a PS drive called Env:61 Instant call of Environment Variables with $env:61 Chapter 24: Error handling62 Introduction62 Examples62 Error Types62 Chapter 25: GUI in Powershell64 Examples64 WPF GUI for Get-Service cmdlet64 Chapter 26.

5 Handling Secrets and Credentials66 Introduction66 Examples66 Prompting for Credentials66 Accessing the Plaintext Password66 Working with Stored Credentials66 Encrypter67 The code that uses the stored credentials:67 Storing the credentials in Encrypted form and Passing it as parameter when Required67 Chapter 27: HashTables69 Introduction69 Remarks69 Examples69 Creating a Hash Table69 Access a hash table value by over a hash table70 Add a key value pair to an existing hash table70 Enumerating through keys and Key-Value Pairs70 Remove a key value pair from an existing hash table71 Chapter 28: How to download latest artifact from Artifactory using PowerShell script ( Script for downloading the latest artifcat72 Chapter 29: Infrastructure Automation73 Introduction73 Examples73 Simple script for black-box integration test of console applications73 Chapter 30: Introduction to Pester74 Remarks74 Examples74 Getting Started with Pester74 Chapter 31: Introduction to Psake76 Syntax76 Remarks76 Examples76 Basic outline76 FormatTaskName example76 Run Task conditionally77 ContinueOnError77 Chapter 32: ISE module78 Introduction78 Examples78 Test Scripts78 Chapter 33.)

6 Loops79 Introduction79 Syntax79 Remarks79 Foreach79 Performance80 Examples80 For80 Foreach80 While81 ForEach-Object81 Basic usage82 Advanced usage82Do83 ForEach() Method83 Continue84 Break84 Chapter 34: Modules, Scripts and Functions86 Introduction86 Examples86 Function86 Demo86 Script87 Demo87 Module88 Demo88 Advanced Functions88 Chapter 35: MongoDB92 Remarks92 Examples92 MongoDB with C# driver using PowerShell92I have 3 sets of array in Powershell92 Chapter 36: Naming Conventions94 Examples94 Functions94 Chapter 37: Operators95 Introduction95 Examples95 Arithmetic Operators95 Logical Operators95 Assignment Operators95 Comparison Operators96 Redirection Operators96 Mixing operand types : the type of the left operand dictates the Manipulation Operators98 Chapter 38: Package management99 Introduction99 Examples99 Find a PowerShell module using a pattern99 Create the default PowerShell Module Reposity99 Find a module by name99 Install a Module by name99 Uninstall a module my name and version99 Update a module by name99 Chapter 39: Parameter sets101 Introduction101 Examples101 Simple parameter sets101 Parameterset to enforce the use of a parmeter when a other is set to limit the combination of parmeters102 Chapter 40: PowerShell "Streams".

7 Debug, Verbose, Warning, Error, Output and Information103 Remarks103 Examples103 Write-Output103 Write Preferences103 Chapter 41: PowerShell Background Jobs105 Introduction105 Remarks105 Examples105 Basic job creation105 Basic job management106 Chapter 42: PowerShell Classes108 Introduction108 Examples108 Methods and properties108 Listing available constructors for a class108 Constructor overloading110 Get All Members of an Instance110 Basic Class Template110 Inheritance from Parent Class to Child Class111 Chapter 43: PowerShell Dynamic Parameters112 Examples112"Simple" dynamic parameter112 Chapter 44: PowerShell Functions114 Introduction114 Examples114 Simple Function with No Parameters114 Basic Parameters114 Mandatory Parameters115 Advanced Function116 Parameter Validation117 ValidateSet117 ValidateRange118 ValidatePattern118 ValidateLength118 ValidateCount118 ValidateScript118 Chapter 45: PowerShell Modules120 Introduction120 Examples120 Create a Module Manifest120 Simple Module Example120 Exporting a Variable from a Module121 Structuring PowerShell Modules121 Location of Modules122 Module Member Visibility122 Chapter 46: PowerShell profiles123 Remarks123 Examples123 Create an basic profile123 Chapter 47.

8 PowerShell Remoting125 Remarks125 Examples125 Enabling PowerShell Remoting125 Only for non-domain environments125 Enabling Basic Authentication125 Connecting to a Remote Server via PowerShell126 Run commands on a Remote Computer126 Remoting serialization warning127 Argument Usage128A best practise for automatically cleaning-up PSSessions128 Chapter 48: PowerShell sql queries130 Introduction130 Parameters130 Remarks130 Examples132 SQLE xample132 SQLQ uery132 Chapter 49: PowerShell Workflows134 Introduction134 Remarks134 Examples134 Simple Workflow Example134 Workflow with Input Parameters134 Run Workflow as a Background Job135 Add a Parallel Block to a Workflow135 Chapter 50: Command-Line136 Parameters136 Examples137 Executing a command137-Command <string>137-Command { scriptblock }137-Command - (standard input)137 Executing a script file138 Basic script138 Using parameters and arguments138 Chapter 51: PSScriptAnalyzer - PowerShell Script Analyzer139 Introduction139 Syntax139 Examples139 Analyzing scripts with the built-in preset rulesets139 Analyzing scripts against every built-in rule140 List all built-in rules140 Chapter 52: Regular Expressions141 Syntax141 Examples141 Single match141 Using the -Match operator141 Using Select-String142 Using [RegEx]::Match()143 Replace143 Using -Replace operator143 Using [RegEx].

9 Replace() method144 Replace text with dynamic value using a MatchEvalutor144 Escape special characters145 Multiple matches145 Using Select-String146 Using [RegEx]::Matches()146 Chapter 53: Return behavior in PowerShell148 Introduction148 Remarks148 Examples148 Early exit148 Gotcha! Return in the pipeline148 Gotcha! Ignoring unwanted output149 Return with a value149 How to work with functions returns150 Chapter 54: Running Executables152 Examples152 Console Applications152 GUI Applications152 Console Streams152 Exit Codes153 Chapter 55: Scheduled tasks module154 Introduction154 Examples154 Run PowerShell Script in Scheduled Task154 Chapter 56: Security and Cryptography155 Examples155 Calculating a string's hash codes via.

10 Net Cryptography155 Chapter 57: Sending Email156 Introduction156 Parameters156 Examples157 Simple Send-MailMessage157 Send-MailMessage with predefined parameters157 SMTPC lient - Mail with .txt file in body message157 Chapter 58: SharePoint Module159 Examples159 Loading SharePoint Snap-In159 Iterating over all lists of a site collection159 Get all installed features on a site collection159 Chapter 59: Signing Scripts161 Remarks161 Execution policies161 Examples162 Signing a script162 Changing the execution policy using Set-ExecutionPolicy162 Bypassing execution policy for a single script162 Other Execution Policies:163 Get the current execution policy163 Getting the signature from a signed script164 Creating a self-signed code signing certificate for testing164 Chapter 60: Special Operators165 Examples165 Array Expression Operator165 Call Operation165 Dot sourcing operator165 Chapter 61.


Related search queries