SlideShare a Scribd company logo
1 of 19
Getting started with PowerShell Scripting Ravikanth C
A lead engineer at Dell SharePoint professional by day and PowerShell scripter at night Blog at http://www.ravichaganti.com/blog Developer of PSCodePlex PSRemoteFileExplorer Remote File Explorer PowerPack BITS File Transfer PowerPack Author of Free eBook - Layman’s guide to PowerShell 2.0 remoting (Coming soon) About me
What is PowerShell? Getting started Using PowerShell Getting Help Tools for the job Learning resources Q & A Agenda
Remote file explorer -> 698 lines of PowerShell This is just one example..! Show me the Power first.!
The best shell scripting environment for Windows A new scripting language Replacement for a weak Windows command-line Default management / automation platform for all Microsoft products going forward Object based Built on top of .NET type system Everything is an object What is PowerShell?
PowerShell is in version 2.0 Default on Windows 7 and Windows Server 2008 Part of Windows management framework download for Windows Server 2008, Vista, XP and Windows 2003 http://support.microsoft.com/kb/968929 Requires .NET 2.0 SP1 or later Getting started
Console history, Intellisense for cmdlets, variables and parameters Using PowerShell: Console
Using PowerShell: ISE
Using PowerShell: Cmdlets ,[object Object]
A lightweight command
an instance of .NET framework classes
Use verb-noun pairs
Get-Verb to list all approved verbs,[object Object]
Types User created variables Automatic variables Created by PowerShell to maintain its state Cannot be modified Examples: $PSHome, $$, $^, $?, etc Preference variables Created by PowerShell to store user preferences Can be modified Examples: $MaximumHistoryCount, etc Using PowerShell: Variables
Alternate names for cmdlets Cmdlets to manage aliases Export-Alias Get-Alias Import-Alias New-Alias Set-Alias Cannot take parameters Workaround: put the statement in a script and alias to that Example: Dir, ls, gcm, gci, etc Using PowerShell: Aliases
Conditional statements If Switch l.ooping For For ($i=0;$i –le 10;$i++)  {Write-Host $i} Foreach Used on a collection of items Foreach ($name in $namesArray) { Write-Host $name } Do Do { Write-Host $i; $i++ } while ($i –le 10) Do { Write-Host $i;$i++} Until ($i –lt 10) While While ($i –le 10) { Write-Host $i;$i++ } Using PowerShell: Conditional & Looping
Comparison operators -ne, -eq, -lt, -gt, -ge, -le, -like, -notlike, -contains, -notcontains, -match, -notmatch Logical operators -or, -and, -xor, -not, ! Arithmetic operators Assignment operators Using PowerShell: Operators
Arrays Collection of objects of the same type $a = @( ) $a = “PowerShell”,”VBScript” Hash Tables Collection of key value pairs $ hash = @{ } $a = {“Name”=“PowerShell”; “IsHot”=$true} Using PowerShell: Arrays & Hash Tables
Getting Help Get-Command Gets a list of all commands  Get-Help Shows help for a given cmdlet Get-Member Gets members of an object Get-PSDrive Shows information stores in PowerShell About_Topics Get-Help about*

More Related Content

What's hot

What's hot (20)

Adventures in Asymmetric Warfare
Adventures in Asymmetric WarfareAdventures in Asymmetric Warfare
Adventures in Asymmetric Warfare
 
Powershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge ClubPowershell Seminar @ ITWorx CuttingEdge Club
Powershell Seminar @ ITWorx CuttingEdge Club
 
Wielding a cortana
Wielding a cortanaWielding a cortana
Wielding a cortana
 
Obfuscating The Empire
Obfuscating The EmpireObfuscating The Empire
Obfuscating The Empire
 
I Hunt Sys Admins
I Hunt Sys AdminsI Hunt Sys Admins
I Hunt Sys Admins
 
Workshop: PowerShell for Penetration Testers
Workshop: PowerShell for Penetration TestersWorkshop: PowerShell for Penetration Testers
Workshop: PowerShell for Penetration Testers
 
Catch Me If You Can: PowerShell Red vs Blue
Catch Me If You Can: PowerShell Red vs BlueCatch Me If You Can: PowerShell Red vs Blue
Catch Me If You Can: PowerShell Red vs Blue
 
Professional Help for PowerShell Modules
Professional Help for PowerShell ModulesProfessional Help for PowerShell Modules
Professional Help for PowerShell Modules
 
Snake bites : Python for Pentesters
Snake bites : Python for PentestersSnake bites : Python for Pentesters
Snake bites : Python for Pentesters
 
Implement server push in flask framework
Implement server push in flask frameworkImplement server push in flask framework
Implement server push in flask framework
 
PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016PowerShell for Cyber Warriors - Bsides Knoxville 2016
PowerShell for Cyber Warriors - Bsides Knoxville 2016
 
PowerShell crash course
PowerShell crash coursePowerShell crash course
PowerShell crash course
 
Defcon - Veil-Pillage
Defcon - Veil-PillageDefcon - Veil-Pillage
Defcon - Veil-Pillage
 
Three Years of Lessons Running Potentially Malicious Code Inside Containers
Three Years of Lessons Running Potentially Malicious Code Inside ContainersThree Years of Lessons Running Potentially Malicious Code Inside Containers
Three Years of Lessons Running Potentially Malicious Code Inside Containers
 
Flask With Server-Sent Event
Flask With Server-Sent EventFlask With Server-Sent Event
Flask With Server-Sent Event
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
 
Multiple django applications on a single server with nginx
Multiple django applications on a single server with nginxMultiple django applications on a single server with nginx
Multiple django applications on a single server with nginx
 
Elixir Into Production
Elixir Into ProductionElixir Into Production
Elixir Into Production
 
Controlling multiple VMs with the power of Python
Controlling multiple VMs with the power of PythonControlling multiple VMs with the power of Python
Controlling multiple VMs with the power of Python
 
Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...
Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...
Lucio Grenzi - Building serverless applications on the Apache OpenWhisk platf...
 

Viewers also liked

Windows - Having Its Ass Kicked by Puppet and PowerShell Since 2012
Windows - Having Its Ass Kicked by Puppet and PowerShell Since 2012Windows - Having Its Ass Kicked by Puppet and PowerShell Since 2012
Windows - Having Its Ass Kicked by Puppet and PowerShell Since 2012
Puppet
 
Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009
John Clayton
 

Viewers also liked (20)

PowerShell Plus v4.7 Overview
PowerShell Plus v4.7 OverviewPowerShell Plus v4.7 Overview
PowerShell Plus v4.7 Overview
 
Practical PowerShell Programming for Professional People - Extended Edition
Practical PowerShell Programming for Professional People - Extended EditionPractical PowerShell Programming for Professional People - Extended Edition
Practical PowerShell Programming for Professional People - Extended Edition
 
Office 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heavenOffice 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heaven
 
Windows Server 2008 (PowerShell Scripting Uygulamaları)
Windows Server 2008 (PowerShell Scripting Uygulamaları)Windows Server 2008 (PowerShell Scripting Uygulamaları)
Windows Server 2008 (PowerShell Scripting Uygulamaları)
 
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
 
PowerShell from *nix user perspective
PowerShell from *nix user perspectivePowerShell from *nix user perspective
PowerShell from *nix user perspective
 
Managing Virtual Infrastructures With PowerShell
Managing Virtual Infrastructures With PowerShellManaging Virtual Infrastructures With PowerShell
Managing Virtual Infrastructures With PowerShell
 
PowerShell UIAtomation
PowerShell UIAtomationPowerShell UIAtomation
PowerShell UIAtomation
 
PowerShell 101
PowerShell 101PowerShell 101
PowerShell 101
 
Windows - Having Its Ass Kicked by Puppet and PowerShell Since 2012
Windows - Having Its Ass Kicked by Puppet and PowerShell Since 2012Windows - Having Its Ass Kicked by Puppet and PowerShell Since 2012
Windows - Having Its Ass Kicked by Puppet and PowerShell Since 2012
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Geek Sync | Using PowerShell with Python and SQL Server
Geek Sync | Using PowerShell with Python and SQL ServerGeek Sync | Using PowerShell with Python and SQL Server
Geek Sync | Using PowerShell with Python and SQL Server
 
Gray Hat PowerShell - ShowMeCon 2015
Gray Hat PowerShell - ShowMeCon 2015Gray Hat PowerShell - ShowMeCon 2015
Gray Hat PowerShell - ShowMeCon 2015
 
Network Mapping with PowerShell
Network Mapping with PowerShellNetwork Mapping with PowerShell
Network Mapping with PowerShell
 
Practical PowerShell Programming for Professional People
Practical PowerShell Programming for Professional PeoplePractical PowerShell Programming for Professional People
Practical PowerShell Programming for Professional People
 
Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009Windows PowerShell - Billings .NET User Group - August 2009
Windows PowerShell - Billings .NET User Group - August 2009
 
PowerShell 101 - What is it and Why should YOU Care!
PowerShell 101 - What is it and Why should YOU Care!PowerShell 101 - What is it and Why should YOU Care!
PowerShell 101 - What is it and Why should YOU Care!
 
44CON London 2015 - Old Dog, New Tricks: Forensics With PowerShell
44CON London 2015 - Old Dog, New Tricks: Forensics With PowerShell44CON London 2015 - Old Dog, New Tricks: Forensics With PowerShell
44CON London 2015 - Old Dog, New Tricks: Forensics With PowerShell
 
Some PowerShell Goodies
Some PowerShell GoodiesSome PowerShell Goodies
Some PowerShell Goodies
 
Managing VMware with PowerShell - VMworld 2008
Managing VMware with PowerShell - VMworld 2008Managing VMware with PowerShell - VMworld 2008
Managing VMware with PowerShell - VMworld 2008
 

Similar to Getting Started With PowerShell Scripting

Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
SharePoint Saturday NY
 
Powershell Training
Powershell TrainingPowershell Training
Powershell Training
Fahad Noaman
 
Automating PowerShell with SharePoint
Automating PowerShell with SharePointAutomating PowerShell with SharePoint
Automating PowerShell with SharePoint
Talbott Crowell
 
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Muhamad Al Imran
 
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Muhamad Al Imran
 
PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)
Concentrated Technology
 

Similar to Getting Started With PowerShell Scripting (20)

Introduction to windows power shell in sharepoint 2010
Introduction to windows power shell in sharepoint 2010Introduction to windows power shell in sharepoint 2010
Introduction to windows power shell in sharepoint 2010
 
NIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShellNIIT ISAS Q5 Report - Windows PowerShell
NIIT ISAS Q5 Report - Windows PowerShell
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
 
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with PowershellBrian Jackett: Managing SharePoint 2010 Farms with Powershell
Brian Jackett: Managing SharePoint 2010 Farms with Powershell
 
Power shell training
Power shell trainingPower shell training
Power shell training
 
PowerShell for SharePoint Developers
PowerShell for SharePoint DevelopersPowerShell for SharePoint Developers
PowerShell for SharePoint Developers
 
Powershell Training
Powershell TrainingPowershell Training
Powershell Training
 
Automating PowerShell with SharePoint
Automating PowerShell with SharePointAutomating PowerShell with SharePoint
Automating PowerShell with SharePoint
 
Simplify your professional web development with symfony
Simplify your professional web development with symfonySimplify your professional web development with symfony
Simplify your professional web development with symfony
 
[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development[Bristol WordPress] Supercharging WordPress Development
[Bristol WordPress] Supercharging WordPress Development
 
PHP and COM
PHP and COMPHP and COM
PHP and COM
 
Intro to PowerShell
Intro to PowerShellIntro to PowerShell
Intro to PowerShell
 
Php i basic chapter 3
Php i basic chapter 3Php i basic chapter 3
Php i basic chapter 3
 
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
 
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
 
No-script PowerShell v2
No-script PowerShell v2No-script PowerShell v2
No-script PowerShell v2
 
PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)PowerShell Core Skills (TechMentor Fall 2011)
PowerShell Core Skills (TechMentor Fall 2011)
 
PHP from soup to nuts Course Deck
PHP from soup to nuts Course DeckPHP from soup to nuts Course Deck
PHP from soup to nuts Course Deck
 
Introduction to powershell
Introduction to powershellIntroduction to powershell
Introduction to powershell
 

More from Ravikanth Chaganti

Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc indiaDesired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
Ravikanth Chaganti
 
Power shell saturday ravikanth
Power shell saturday  ravikanthPower shell saturday  ravikanth
Power shell saturday ravikanth
Ravikanth Chaganti
 

More from Ravikanth Chaganti (20)

Azure Bicep - An Introduction
Azure Bicep - An IntroductionAzure Bicep - An Introduction
Azure Bicep - An Introduction
 
Azure CLI 2.0 Tips and Tricks
Azure CLI 2.0 Tips and TricksAzure CLI 2.0 Tips and Tricks
Azure CLI 2.0 Tips and Tricks
 
Tests Driven PowerShell Learning
Tests Driven PowerShell LearningTests Driven PowerShell Learning
Tests Driven PowerShell Learning
 
PowerShell Data as File System
PowerShell Data as File SystemPowerShell Data as File System
PowerShell Data as File System
 
Azure at the command line
Azure at the command lineAzure at the command line
Azure at the command line
 
Microsoft Azure Cloud and DevOps
Microsoft Azure Cloud and DevOpsMicrosoft Azure Cloud and DevOps
Microsoft Azure Cloud and DevOps
 
Using PowerShell DSC with AWS Cloud and CloudFormation
Using PowerShell DSC with AWS Cloud and CloudFormationUsing PowerShell DSC with AWS Cloud and CloudFormation
Using PowerShell DSC with AWS Cloud and CloudFormation
 
Developing Infrastructure Code for CI & CD
Developing Infrastructure Code for CI & CDDeveloping Infrastructure Code for CI & CD
Developing Infrastructure Code for CI & CD
 
PowerShell DSC Partial Configurations and Cross-node Synchronization
PowerShell DSC Partial Configurations and Cross-node SynchronizationPowerShell DSC Partial Configurations and Cross-node Synchronization
PowerShell DSC Partial Configurations and Cross-node Synchronization
 
Operations Validation for Infrastructure As Code - PSConfEU 2016
Operations Validation for Infrastructure As Code - PSConfEU 2016Operations Validation for Infrastructure As Code - PSConfEU 2016
Operations Validation for Infrastructure As Code - PSConfEU 2016
 
Authoring Azure Resource Manager Templates - Future Unleashed 2015
Authoring Azure Resource Manager Templates - Future Unleashed 2015Authoring Azure Resource Manager Templates - Future Unleashed 2015
Authoring Azure Resource Manager Templates - Future Unleashed 2015
 
Cloud Computing for IT professionals
Cloud Computing for IT professionalsCloud Computing for IT professionals
Cloud Computing for IT professionals
 
Introduction to Microsoft Azure Compute
Introduction to Microsoft Azure ComputeIntroduction to Microsoft Azure Compute
Introduction to Microsoft Azure Compute
 
Cross platform configuration management using Desired State Configuration
Cross platform configuration management using Desired State ConfigurationCross platform configuration management using Desired State Configuration
Cross platform configuration management using Desired State Configuration
 
Windows Server 2012 R2 Hyper-V Replica
Windows Server 2012 R2 Hyper-V ReplicaWindows Server 2012 R2 Hyper-V Replica
Windows Server 2012 R2 Hyper-V Replica
 
Whats new in Windows Server 2012 R2 Hyper-V
Whats new in Windows Server 2012 R2 Hyper-VWhats new in Windows Server 2012 R2 Hyper-V
Whats new in Windows Server 2012 R2 Hyper-V
 
Configuration management comes to Windows
Configuration management comes to WindowsConfiguration management comes to Windows
Configuration management comes to Windows
 
Desired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc indiaDesired state-configuration-ravikanth-august-2013-vtc india
Desired state-configuration-ravikanth-august-2013-vtc india
 
Power shell saturday ravikanth
Power shell saturday  ravikanthPower shell saturday  ravikanth
Power shell saturday ravikanth
 
PowerShell 3.0 workflows
PowerShell 3.0 workflowsPowerShell 3.0 workflows
PowerShell 3.0 workflows
 

Recently uploaded

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Getting Started With PowerShell Scripting

  • 1. Getting started with PowerShell Scripting Ravikanth C
  • 2. A lead engineer at Dell SharePoint professional by day and PowerShell scripter at night Blog at http://www.ravichaganti.com/blog Developer of PSCodePlex PSRemoteFileExplorer Remote File Explorer PowerPack BITS File Transfer PowerPack Author of Free eBook - Layman’s guide to PowerShell 2.0 remoting (Coming soon) About me
  • 3. What is PowerShell? Getting started Using PowerShell Getting Help Tools for the job Learning resources Q & A Agenda
  • 4. Remote file explorer -> 698 lines of PowerShell This is just one example..! Show me the Power first.!
  • 5. The best shell scripting environment for Windows A new scripting language Replacement for a weak Windows command-line Default management / automation platform for all Microsoft products going forward Object based Built on top of .NET type system Everything is an object What is PowerShell?
  • 6. PowerShell is in version 2.0 Default on Windows 7 and Windows Server 2008 Part of Windows management framework download for Windows Server 2008, Vista, XP and Windows 2003 http://support.microsoft.com/kb/968929 Requires .NET 2.0 SP1 or later Getting started
  • 7. Console history, Intellisense for cmdlets, variables and parameters Using PowerShell: Console
  • 9.
  • 11. an instance of .NET framework classes
  • 13.
  • 14. Types User created variables Automatic variables Created by PowerShell to maintain its state Cannot be modified Examples: $PSHome, $$, $^, $?, etc Preference variables Created by PowerShell to store user preferences Can be modified Examples: $MaximumHistoryCount, etc Using PowerShell: Variables
  • 15. Alternate names for cmdlets Cmdlets to manage aliases Export-Alias Get-Alias Import-Alias New-Alias Set-Alias Cannot take parameters Workaround: put the statement in a script and alias to that Example: Dir, ls, gcm, gci, etc Using PowerShell: Aliases
  • 16. Conditional statements If Switch l.ooping For For ($i=0;$i –le 10;$i++) {Write-Host $i} Foreach Used on a collection of items Foreach ($name in $namesArray) { Write-Host $name } Do Do { Write-Host $i; $i++ } while ($i –le 10) Do { Write-Host $i;$i++} Until ($i –lt 10) While While ($i –le 10) { Write-Host $i;$i++ } Using PowerShell: Conditional & Looping
  • 17. Comparison operators -ne, -eq, -lt, -gt, -ge, -le, -like, -notlike, -contains, -notcontains, -match, -notmatch Logical operators -or, -and, -xor, -not, ! Arithmetic operators Assignment operators Using PowerShell: Operators
  • 18. Arrays Collection of objects of the same type $a = @( ) $a = “PowerShell”,”VBScript” Hash Tables Collection of key value pairs $ hash = @{ } $a = {“Name”=“PowerShell”; “IsHot”=$true} Using PowerShell: Arrays & Hash Tables
  • 19. Getting Help Get-Command Gets a list of all commands Get-Help Shows help for a given cmdlet Get-Member Gets members of an object Get-PSDrive Shows information stores in PowerShell About_Topics Get-Help about*
  • 20. In PowerShell, there will be more than one way to do the same thing. For example [System.Diagnostics.Process]::GetProcesses() Get-Process Understand execution policies Use PowerShell profiles Best practices
  • 21. PowerShell Console PowerShell ISE PowerGUI AdminConsole PowerGUI ScriptEditor PowerWF PowerShell Plus Tools for the job
  • 22. Getting started guide PowerShell Learning center Free PowerShell eBook The scripting Guys blog PowerScripting Podcast @PSBUG on Twitter Learning resources