Scripte

2654 palavras 11 páginas
PowerShell Tutorial
Erik Hjelmås
March 21, 2012

(OUSTERHOUT, J., “Scripting: Higher-Level Programming for the 21st Century”, IEEE Computer, Vol. 31, No.
3, March 1998, pp. 23-30.)

From Ousterhout, 1998:
While programming languages like C/C++ are designed for low-level construction of data structures and algorithms, scripting languages are designed for high-level “gluing” of existing components. Components are created with low-level languages and glued together with scripting languages.
WARNING!
The following presentation is NOT meant to be a comprehensive/complete tour of the PowerShell language.
The purpose is to get you started with some basic program constructions which you will recognize based on some-sort-of-programming-background.
At the end of the presentation (Credits section) you will find pointers to more comprehensive material (reference material).
Practice
You need a Windows host running on a physical or virtual machine with working access to the internet, and with PowerShell v2.0 installed.
2

Log in and open a terminal window, download the examples as we go along from http :// www . hig . no /~ erikh / t u t o r i a l - p o w e r s h e l l / FILENAME

(or download all at once with filename powershell-examples.zip but remember to unblock before unzip)
You will find the FILENAME on the first line of each example. For each example do 1. Download wget http://www.hig.no/~erikh/tutorial-powershell/FILENAME
2. View the code
Get-Content FILENAME
3. Execute the code
.\FILENAME
We assume that you are using PowerShell 2.0 (as shipped with Windows 7 and
Windows Server 2008R2) and have installed the PowerShell Community Extensions from http://pscx.codeplex.com/ and the GnuWin32 utilities http:
//sourceforge.net/projects/getgnuwin32/files/ (where you will find wget etc). To allow for execution of scripts in powershell you need to set the correct execution policy:
# check what is current policy
Get-ExecutionPolicy
# change

Relacionados

  • A Busca Do Corpo Perfeito Scripte
    974 palavras | 4 páginas
  • AJAX
    496 palavras | 2 páginas
  • fff mdksd
    4273 palavras | 18 páginas
  • 2006 Bioinformatica Tese FabioNakano
    19467 palavras | 78 páginas