SlideShare una empresa de Scribd logo
1 de 138
Descargar para leer sin conexión
Présentation de la 
formation 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Powershell 2.0 alphorm.com™©
Introduction 
Powershell 2.0 alphorm.com™©
Plan 
• Présentation du formateur. 
• Prérequis de cette formation. 
• Quelques références. 
• Présentation de la formation. 
Powershell 2.0 alphorm.com™©
Présentation du formateur 
• Présentation 
• Stéphane van Gulick 
 Ingénieur Systèmes et automatisation 
 MCTS, MCITP EA, MCSA 
 Blog : http://PowerShellDistrict.com 
 Twitter : @stephanevg 
Powershell 2.0 alphorm.com™©
Prérequis de cette formation 
 Connaissances des systèmes Windows 
 Une expérience en Scripting est un plus. (Mais pas obligatoire !) 
 Compréhension de principes algorithmiques (tel que les « IF, ELSE, FOREACH) 
etc.. 
 Être motivé et enthousiaste ! 
 Lab: 
• 1 machine Windows 7 
• (une deuxième machine windows 7 pour le chapitre sur le remoting). 
Powershell 2.0 alphorm.com™©
Quelques références 
• Version CHM de l’aide PowerShell http://www.microsoft.com/en-us/ 
download/details.aspx?id=10552 
• Script center  http://technet.microsoft.com/en-us/scriptcenter/ 
• Blog Scripting Guy  http://blogs.technet.com/b/heyscriptingguy/ 
• Livres - 
 Windows PowerShell Guide de référence  
 PowerShell in Action  
Powershell 2.0 alphorm.com™©
Présentation de la formation 
3 grandes parties 
Chapitres 
Modules 
Powershell 2.0 alphorm.com™©
Présentation de la formation 
1. L’initiation au PowerShell 2.0 
Chapitre 1 : Introduction à PowerShell 
1. Présentation de la formation 
2. Introduction générale a Windows PowerShell 
Chapitre 2 : L’apprentissage de PowerShell 
1. Introduction au langage 
2. Opérateurs et expressions 
3. La gestion du flux (l’utilisation du pipe) 
4. Importer des données depuis des supports externes. 
Powershell 2.0 alphorm.com™©
Présentation de la formation 
• Partie 2 : L’utilisation avancé de PowerShell 2.0 
 Chapitre 3 L’utilisation avancé de PowerShell : Le scripting 
1. Les fonctions et les filtres 
2. La gestion d’erreur 
3. Les fonctions avancées 
 Chapitre 4 : La maitrise de PowerShell en travaillant à grande échelle 
1. Les modules 
2. L’execution à distance 
3. L’execution en tâche de fond : “Les jobs” 
Powershell 2.0 alphorm.com™©
Présentation de la formation 
Partie 3 : Maîtrise de PowerShell 2.0 
Chapitre 5: Créer ses propres cmdlets 
• Le WMI 
• L’automatisation d’applications (Com objects) 
• L’exploitation du dotnet 
Conclusion 
Powershell 2.0 alphorm.com™©
Are you ready ? ☺ 
Let’s GO ! 
Powershell 2.0 alphorm.com™©
Initiation à PowerShell 
Introduction à Windows PowerShell 
Introduction générale à 
Windows PowerShell 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan 
1. Qu’est-ce PowerShell ? 
2. Les différents versions existantes de PowerShell. 
3. Prérequis nécessaire pour l’installation / l’utilisation de PowerShell. 
4. Présentation du prompt, et de l’environnement de Scripting intégré. 
5. Découverte des premières commandes. 
Powershell 2.0 alphorm.com™©
Les avantages à utiliser Windows PowerShell ? 
 Automatisation de tâches récurrentes / répétitives. 
 Réduit le temps d’effort nécessaire pour l’accomplissement de cette tâche. 
 Permet de paralléliser plusieurs tâches à la fois. 
 Réduit la probabilité d’erreur. 
 Possibilité de déléguer une tâche plus facilement. 
 Est idéal pour la réutilisabilité. 
 Permet d’aller au-delà des limites des interface graphiques. 
Powershell 2.0 alphorm.com™©
Présence de Windows PowerShell 
Système d’éxploitation PowerShell 2.0 
Windows XP PowerShell 2.0 (Facultatif) 
Windows Server 2003 PowerShell 2.0 (Facultatif) 
Windows Vista PowerShell 2.0 (Facultatif) 
Windows 7 PowerShell 2.0 (Natif) 
Windows Server 2008 PowerShell 2.0 (Natif) 
Windows 8 PowerShell 3.0 (Natif) 
Windows Server 2012 PowerShell 3.0 (Natif) 
Windows 8.1 PowerShell 4.0 (Natif) 
Windows Server 2012 R2 PowerShell 4.0 (Natif) 
Powershell 2.0 alphorm.com™©
Prérequis à l’installation de Windows PowerShell 
Powershell Windows Management 
framework 
Prérequis Lien 
2.0 WMF 2.0 Dotnet 2.0 http://support.microsoft.com/k 
b/968929/fr 
3.0 WMF 3.0 Dotnet 3.5 http://support.microsoft.com/k 
b/2506143/fr 
4.0 WMF 4.0 Dotnet 4.5 http://www.microsoft.com/fr-fr/ 
download/details.aspx?id=4 
0855 
Powershell 2.0 alphorm.com™©
Découverte de la console PowerShell + ISE 
Prompt PowerShell 
Console ISE 
Powershell 2.0 alphorm.com™©
Prompt – Récapitulatif 
Commande Résultat 
F1 Réécris la dernière commande 
lettre par lettre. 
F3 Auto complète une commande. 
F4 Supprime jusqu’au curseur. 
F5 Remonte dans l’historique des 
commandes. 
F7 Affiche l’historique des 
commandes. (CTRL+F7 l’efface) 
Commande Résultat 
Alt+ espace +E Navigue vers menu édition. 
CTRL+C Cesse l’exécution de la 
commande en cours. 
CTRL+S Pause l’affichage en cours. 
CTRL + end Supprime tout depuis le 
curseur. 
F8 Auto complète votre ligne avec 
votre historique. 
F9 Spécifie une ligne de l’historique 
précise (F7) 
Tab / Shift + tab Auto complète votre commande. 
Flèche haut / bas Navigue dans l’historique des 
commandes. (F7) 
échappe Efface la ligne entière. 
CTRL + Fleche 
gauche / droite 
Navigue sur la ligne du prompt 
mot par mot. 
Powershell 2.0 alphorm.com™©
ISE – Récapitulatif 
Commande Résultat 
CTRL+O Ouvre un script. 
CTRL+N Nouveau script. 
CTRL+S Sauvegarde le script. 
CTRL+T Nouvel onglet. 
CTRL+W Nouvel onglet réseau. 
F5 Exécution du code en cours. 
F8 Exécution d’une sélection du 
code. 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
1. Qu’est-ce PowerShell ? 
2. Les différents versions existantes de PowerShell. 
3. Prérequis pour nécessaire pour l’installation de PowerShell. 
4. Présentation du prompt, et de l’environnement de Scripting intégré. 
5. Navigation et raccourcis clavier. 
6. Découverte des premières commandes de base. 
Powershell 2.0 alphorm.com™©
Initiation à Windows PowerShell 
Apprentissage de PowerShell 
Introduction au langage 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan 
• Vous connaissez déjà le PowerShell ! 
• Présentation de la structure et découverte premières commandes 
• Comment trouver de l’aide ? 
• Les variables 
Powershell 2.0 alphorm.com™©
Le PowerShell vous connaissez déjà ! 
Les aliases 
Dir 
del 
Pusd 
Pwd 
Cls 
Powershell 2.0 alphorm.com™©
Structure des commandes 
Verbe-nom 
Get-help 
Get-Command 
Set-wmiObject 
Move- 
Adcomputer 
Read-host 
Powershell 2.0 alphorm.com™©
Comment trouver de l’aide ? 
• Get-help nom de la commande 
• Get-command 
• Get-member (gm) 
• Internet : PowerShell + commande (ou action a réaliser) 
Powershell 2.0 alphorm.com™©
Les variables : Récapitulatif 
Nom Type Exemple 
String [string] Texte Bonjour 
Array [array]Tableau Bonjour, Bonsoir, salut 
Integer [int]Entier 1, 400, 1000, 14 
Double [double]Doubl 
14.456, 1.5, 78,4 etc… 
assignation 
$=contenue 
$=commande 
$=Opération 
Cmdlets 
Get-variable 
e 
Date [date]Une 
date 
11/10/2013, etc… 
Hashtable @{} Jean;25 
Michel;23 
Hamid;30 
Set-variable 
Clear-variable 
Remove-variable 
New-variable 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
• Présentation de la structure et découverte des premières commandes 
• Comment trouver de l’aide. 
• Les variables. 
Powershell 2.0 alphorm.com™©
Initiation à Windows PowerShell 
Apprentissage de PowerShell 
Opérateurs et 
expressions 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan 
• Opérateurs arithmétiques 
• Opérateurs d’assignation 
• Opérateurs de comparaison 
• Opérateurs de traitement de texte 
• Opérateurs logiques 
Powershell 2.0 alphorm.com™©
Opérateurs Arythmétiques 
Operateur Signification 
+ Addition 
- Soustraction 
/ Division 
* multiplication 
% Modulo 
Powershell 2.0 alphorm.com™©
Opérateurs de d’assignation 
Operateur Signification 
= Assigniation. 
+= Assignation an 
gardant la valeur 
precedente. 
-= Sous trait en 
reasignant le 
resultat. 
/= Divise en 
reasignant le 
resultat. 
%= Divise et assigne 
le modulo à la 
variable. 
Powershell 2.0 alphorm.com™©
Opérateurs de comparaison 
Operateur Signification Variante 
sensible à 
la casse 
Variante 
insensible à 
la casse 
-eq Equal -ceq -ieq 
-ne Not equal -cne -ine 
-gt Greather then -cgt -igt 
-ge Greather or 
equal 
-cge -ige 
-lt Less then -clt -ilt 
-le Less or equal -cle -ile 
Powershell 2.0 alphorm.com™©
Les opérateurs de traitement de text 
Operateur Significati 
on 
Variante 
sensible à 
la casse 
Variante 
insensible 
à la casse 
-like comme -clike -ilike 
-notlike Pas comme -cnotlike -inotlike 
-match Correspond -cmatch -imatch 
Operateur Signification 
-replace remplace 
-join concatène 
-split Sépare 
-notmatch Correspond 
pas 
-cnotmatch -inotmatch 
Operateur Signification 
-contains Contient 
-Notcontains Ne contient 
pas 
Powershell 2.0 alphorm.com™©
Les opérateurs logiques 
Operateur Signification Variante 
Bits 
-and et -band 
-or ou -bor 
-not non -bnot 
-xor Ou exclusif -bxor 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
• Opérateurs arithmétiques 
• Opérateurs d’assignation 
• Opérateurs de comparaison 
• Opérateurs de traitement de texte 
• Opérateurs logiques 
• Lien: 
http://www.cheatography.com/davechild/cheat-sheets/ 
regular-expressions/ 
Powershell 2.0 alphorm.com™©
Initiation à Windows PowerShell 
Apprentissage de PowerShell 
Les providers 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan 
• Que sont les providers ? 
• Pourquoi utiliser les providers ? 
• Démonstration 
Powershell 2.0 alphorm.com™©
Les providers 
• Que sont les providers ? 
 C’est un adaptateur PowerShell. Cela permet d’utiliser certaines parties du 
system de la même manière que l’utilisation du FileSystem sous dos par 
exemple. 
• Pourquoi utiliser les providers ? 
 Cela permet de naviguer et d’effectuer des opérations de base dans un 
système (comme le registre Windows) de la même manière que dans un 
sytème de fichier. 
• Les commandes à utiliser dans les providers 
• Get-Item, Copy-Item, Remove-Item … 
Powershell 2.0 alphorm.com™©
Les providers 
• Démonstration : 
 Les providers disponibles 
 Les commandes à utiliser au sein des providers 
 Un exemple concret 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
 Pourquoi utiliser les providers 
 Les providers disponibles 
 Les Commandes 
• Get-Item, Clear-Item, Remove-Item 
 Le chargement d’un module rajoute également un provider supplémentaire 
(Module Active Directory) 
Powershell 2.0 alphorm.com™©
Initiation à Windows PowerShell 
Apprentissage de PowerShell 
La gestion du flux 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan 
• Le pipe 
 La rédaction de « one liners » à l’aide du « Pipe » 
• Les operateur de conditions 
• Les boucles 
• Les switchs 
• Démonstration 
Powershell 2.0 alphorm.com™©
Le pipe « | » 
• A quoi ça sert ? 
• Export vers des fichiers externes 
• « Piper » des résultats vers d’autres commandes 
 (Permet la rédaction de « one liners » ) 
• Démonstration 
Powershell 2.0 alphorm.com™©
Les opérateurs de condition 
Les opérateurs 
de conditions 
Signification 
If Si 
Elseif sinon si 
else sinon 
• Démonstration 
Powershell 2.0 alphorm.com™©
Les boucles 
Les boucles Signification 
While Tant que 
Do while Fait tantque 
Do until Fait jusqu’à 
Foreach Pour chaque 
• Démonstration 
For Pour 
Powershell 2.0 alphorm.com™©
Les switchs 
• Dans quel cas utiliser un switch 
• La structure du switch 
• Démonstration 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
• Le pipe 
 La rédaction de « one liners » à l’aide du « Pipe » 
• Les operateur de conditions 
• Les boucles 
• Les switchs 
Powershell 2.0 alphorm.com™©
Initiation à Windows PowerShell 
Apprentissage de PowerShell 
Import de données 
externes 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan 
•Pourquoi importer des données ? 
• Import/export depuis différents supports: 
• Fichiers textes 
• Fichiers CSV 
• Fichiers XML 
•Export HTML 
Powershell 2.0 alphorm.com™©
Pourquoi importer/exporter des données ? 
• Import: 
 Pour faire un travail de moyen / grande échelle. 
 Traiter des données fournies par d’autres services. 
 Afin de garantir une base de travail stable. 
• Export: 
 Exporter des rapports. 
 Une nouvelle base de travail. 
 Etc… 
Powershell 2.0 alphorm.com™©
Fichiers textes: 
• Import 
 Get-content 
• Export 
 Out-file (, ) 
Possibilité de lire le fichier pendant que Out-file l’utilise) 
•  Set-content 
• Attendre la fin de set-content pour pouvoir lire le fichier 
 Add-content 
Powershell 2.0 alphorm.com™©
Fichiers CSV: 
• Import 
 Import-csv 
• Export 
 Export-csv 
Dans le Shell 
•  ConvertTo-CSV 
 ConverTFrom-CSV 
Powershell 2.0 alphorm.com™©
Fichiers XML: 
• Import 
 Import-CLIXML (Objets exportés avec Export-CliXml) 
 [xml]$ContenueXml = Get-content –path $FichierXml 
• Export 
Export-CliXML 
  $variable.save(C:alpormationconfigurationDatas.xml) 
• Dans le Shell 
 ConvertTo-XML 
Powershell 2.0 alphorm.com™©
Export-html 
• Export 
 ExportTo-HTML 
• Modifier le style (Css) 
 Head 
 Body 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
• Import/export depuis différents supports: 
 Fichiers textes. 
 Fichiers CSV. 
 Fichiers XML 
 Fichiers HTML 
• A retenir : 
 Caster : [XML]$MaVariable = Get-Content –path c:fichier.xml 
 « Rapports » ConvertTo-Html 
Powershell 2.0 alphorm.com™©
L’utilisation avancée de Windows PowerShell 
Le scripting 
Les fonctions 
et les filtres 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan 
• Qu’est ce qu’une fonction ? 
• Qu’est ce qu’un filter ? 
• Les différences entre une fonction et un filter. 
• Quand utiliser une fonction, quand utiliser un filter ? 
Powershell 2.0 alphorm.com™©
Les fonctions : La théorie 
• Utilité: 
 S’exécute seulement une fois que tous les éléments du pipe sont chargés. 
 Permet d’écrire et de nommer un bout de code qui peut être rappeler a tout 
moment. 
 Permet d’effectuer une action qui va ou non, retourner une valeur / object 
 Gain d’espace au sein du code. 
 Organisation du code (Clarté du code). 
 Gain de temps lors du codage (Réutilisabilité) . 
Powershell 2.0 alphorm.com™©
Les Filters : La théorie 
• Utilité 
 Commence à exécuté du code dés qu’elle reçoit du contenue 
 S’utilise de la même manière qu’une fonction. 
 A exactement les même avantages qu’une fonction. 
• Structure du code 
• Gain de place, gain de temps, réutilisation de code etc.. 
• Démonstration 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
• Qu’est ce qu’une fonction ? 
• Qu’est ce qu’un filter ? 
• Les différences entre une fonction et un filter 
• Quand utiliser une fonction, quand utiliser un filter ? 
Powershell 2.0 alphorm.com™©
L’utilisation avancée de Windows PowerShell 
Le scripting 
La gestion d’erreur 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Introduction 
Powershell 2.0 alphorm.com™©
Plan 
• ExecutionPolicy 
• Les différents types d’erreurs. 
• Le comportement de PowerShell face à une erreur. 
• Le détail d’une erreur. 
• Prévoir les erreurs, et agir en conséquence. 
Powershell 2.0 alphorm.com™©
ExecutionPolicy 
Valeur Comportement lors de la rencontre d’une erreur 
Resitricted Impossible d’éxécuter des scripts. Possibilité 
d’utiliser le prompt uniquement (mode interactif). 
AllSigned Seulement les scripts qui sont signés peuvent être 
exécutés. 
Remote signed Les scripts téléchargés doivent être signés avant 
d’être exécutés. 
unrestricted Pas de restrictions. (demande de confirmation avant 
exécution d’un script). 
Bypass Aucune restriction, pas de demande de confirmation. 
Powershell 2.0 alphorm.com™©
Les différent types d’erreurs 
• Les erreurs non-critiques (Non-Terminating). 
• Les erreurs critiques (Terminating). 
Powershell 2.0 alphorm.com™©
Le comportement de PowerShell face à une erreur 
• La variable $errorractionpreference 
Valeur Comportement lors de la rencontre d’une erreur 
SilentlyContinue Le script continue son exécution sans affichage. 
Continue Le script continue son exécution, tout en affichant 
l’erreur. 
Stop Le script s’intérompt (Erreur critique). 
Inquire Demande comment ce comporter. 
Powershell 2.0 alphorm.com™©
Le détail d’une erreur. 
• Le contenu de la variable $error . 
Powershell 2.0 alphorm.com™©
Prévoir les erreurs, et agir en conséquence 
• $? 
• Trap {} 
• Try{}, Catch {}, Finally {} 
• Throw {} 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
• Les erreurs critiques et non-crtitiques 
• Les differentes variables d’erreurs: 
 $erroractionpreference 
 $error 
 $? 
• Ce que contient finalement une erreur  c’est un object ! 
• Comment prévoir une erreur 
 try, catch, finally 
 Throw 
Powershell 2.0 alphorm.com™©
L’utilisation avancée de Windows PowerShell 
Le scripting 
Les fonctions avancées 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan 
• Qu’est ce qu’une fonction avancé? 
• Les « CmdletBinding » attributs 
• Les « Parameter » attributs 
• Documenter notre fonction 
Powershell 2.0 alphorm.com™©
Les fonctions avancées: La théorie 
• Qu’est ce qu’une fonction avancé? 
 Identique à une fonction « normal » sauf qu’elle permet plus de contrôle 
• Intégration de fonctionalités natives tel que le –Verbose ou encore le - 
debug 
• Control des paramètres 
- Permet la validation des paramètres 
- Création d’aide 
- Intégration d’aliases 
- Permettre le paramètre de provenir du « pipe » 
Powershell 2.0 alphorm.com™©
Les « CmdletBinding » attributs 
• Utilité 
 Doit ce mettre toujours avant la section Param() 
 Permet l’activation des fonctionalités natives tel que le –verbose, -whatif, - 
debug, -confirm 
• Démonstration. 
Powershell 2.0 alphorm.com™©
Les « Parameter » attributs 
• Utilité 
 Permet de mettre de conditions de validation, et de control sur les différents 
paramètres de nos fonctions 
• Mandatory 
 Force ou non qu’un valeur soit passé pour ce paramètre 
• Position 
 Permet de définir une position fixe pour un certain paramètre 
• ValueFromPipeLine 
 Permet de d’accepter ou non, qu’un paramètre provienne du pipe 
Powershell 2.0 alphorm.com™©
Les « Parameter » attributs (suite) 
• ValueFromPipeLineByPropertyName 
 Permet la de passer des paramètre via le pipe portant le même nom 
(exemple : « ComputerName ») 
• ValueFromRemainingArguments 
 Permet d’utiliser ou non les arguments restant contenue dans le pipe 
• HelpMessage 
 Permet de spécifier un message d’aide. 
• ValidateSet 
• ValidateScript 
Powershell 2.0 alphorm.com™©
Documenter notre fonction 
• Les commentaires 
 L’utilisation du signe « # » 
 L’utilisation d’un champ de commentaire plus large : « # « code » # » 
Powershell 2.0 alphorm.com™©
Le « comment-based help » 
• Comment créer une aide « professionnel » 
 Il s’agit de mettre des tags à l’interieur d’un champ de commentaire # # 
 .SYNOPSIS: Permet de spécifier en une phrase courte l’utilité du script ou de 
la fonction 
 .DESCRIPTION: La description est généralement plus long. Elle permet 
d’écrire ce que le script fait en détail 
 .PARAMETER NomDuParametre: Permet d’afficher des information 
concernant les paramètres de notre fonction (exemple : Computername) 
 .EXAMPLE: Permet de spécifier un exemple précis concernant l’utilisation de 
la fonction / script. 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
• Qu’est ce qu’une fonction avancé? 
• Les « CmdletBinding » attributs 
• Les « Parameter » attributs 
• Documenter notre fonction 
 Les commentaires 
 Le comment-based help 
Powershell 2.0 alphorm.com™©
L’utilisation avancée de Windows PowerShell 
Le travail à grande échelle 
Les modules 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan 
• Qu’est-ce un module PowerShell ? 
• Les différents types de modules existants. 
• Comment créer son propre module. 
• Les Modules manifest. 
• Comment créer son propre manifest. 
Powershell 2.0 alphorm.com™©
Qu’est ce un module ? 
• Permet de regrouper un grand nombe de fonctions dans un même 
endroit. 
• Facilite la distribution. 
• Facilite l’accès à des nouvelles fonctionalités qui ne sont pas toujours 
nécessaires. 
• Facilite le partage. 
• Permet la standardisation de fonctions de base. 
Powershell 2.0 alphorm.com™©
Les différents types de modules existants 
• Binary modules 
 Code écrit en C# 
 Extension .DLL 
• Script modules 
Basés sur des fichiers textes contenants des fonctions 
  Extension .PSM1 
Powershell 2.0 alphorm.com™©
Les commandes de base 
• Get-module 
• Import-module 
• Remove-module 
• Démonstration 
Powershell 2.0 alphorm.com™©
Comment créer un script module 
• Fichier text 
• Fonctions 
• Extension .psm1 
• Démonstration 
Powershell 2.0 alphorm.com™©
Les modules manifest 
• Qu’est un module manifest ? 
 A été créer pour pouvoir créer de modules de manière pouvoir les distribuer 
a grande échelle 
 Contiendras les informations tel que : L’auteur, le copyright, Nom de 
l’entreprise, version de PowerShell a utiliser etc… 
 C’est un fichier avec l’extension .psd1 
• Démonstration 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
• Qu’est-ce un module PowerShell ? 
• Les différents types de modules existants 
• Les Modules manifest 
Powershell 2.0 alphorm.com™©
L’utilisation avancée de Windows PowerShell 
Le travail à grande échelle 
L’exécution à distance 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan: L’exécution à distance 
• Les prérequis 
• Les commandes offrant nativement des fonctionnalités d’exécution a 
distance. 
• Les connexions Non-Persistantes 
• Les connexions Persistantes Interactives 
• Les connexions Persistantes Non-interactives 
Powershell 2.0 alphorm.com™©
Les prérequis 
 Windos remote management (WINRM)  Désactivée par défaut. 
• Web Services for management (WS-MAN) 
• HTTP, HTTPS (WINRM 2.0 5985) 
 Par défaut, il est possible pour toute machine eéquipée de PowerShell 2.0 
d’initier des connections distances. 
 Certaines conditions doivent être respectées pour pouvoir accepter ses 
connections. 
Powershell 2.0 alphorm.com™©
Les prérequis –Mise en place 
• Une machine en workgroup 
 Enable-PsRemoting 
• Active le service WinRM, Intègre Set-WSMANQuickConfig 
• Déploiement en grande échelle(GPO) 
Computer Configuration-Policies-Administrative templates-Windows Components 
  Configuration  Policies  WindowsSettings  SecuritySettings  SystemServices 
Windows  Windows remote management = Automatic 
• TOUJOURS ouvrir en tant que “Administrator” 
Powershell 2.0 alphorm.com™©
Les commandes et le remoting 
• Beaucoup de commandes permettent déjà de faire de l’execution a 
distance via “-computername” 
• Démonstration 
Powershell 2.0 alphorm.com™©
Cmdlet avec -computerName 
• Get-WinEvent 
• Get-Counter 
• Get-EventLog 
• Clear-EventLog 
• Remove- 
EventLog 
• Get-WmiObject 
• Get-Process 
• Get-Service 
• Add-Computer 
• Remove-Computer 
• Rename-Computer 
• Reset- 
ComputerMachineP 
• Write-EventLog 
• Limit-EventLog 
• Show-EventLog 
• New-EventLog 
• Remove-EventLog 
• Get-WmiObject 
• Set-Service 
• Get-HotFix 
• Restart- 
Computer 
• Stop-Computer 
• Add-Computer 
assword 
Powershell 2.0 alphorm.com™©
Les connections Non-Persistantes Non-interactives 
 Invoke-command 
 L’exécution d’une seule commande voir d’un script à distance. 
 Fonctionne en 3 étapes: 
• Établissement de le connexion 
• Envois de la commande / script 
• Fermeture de la connexion 
 Démonstration 
Powershell 2.0 alphorm.com™©
Les connections Non-Persistantes Non-interactives 
• Les inconvénients de invoke-command 
 Est peut être simple d’utilisation mais la création de connexion, vérification de 
version etc est lourd pour l’os. 
 Ne permet pas de travailler de manière interactive 
 Impossibilité de garder des variables / fonctions chargées en mémoire 
• Avantages 
 Permet de deployer un script /commandes sur plusieurs machines distantes 
Powershell 2.0 alphorm.com™©
Connection Persistante interactive 
• Possibilité de créer une session, executer des commandes, scripts, de 
quitter la session, puis de reprendre la session la ou elle s’était arrêter. 
• Enter-PsSession 
• Démonstration 
Powershell 2.0 alphorm.com™©
Connexion Persistante Non-interactive 
• Ouvrir et fermer la connexion après chaque exécution de commande / 
script est lourd. 
• Permet de créer une connexion persistante 
• Elle est non-interactive (ne permet pas de travailler sur le retour des 
commandes) 
• New-PsSession 
• Démonstration 
Powershell 2.0 alphorm.com™©
TroubleShooting 
• Service WINRM toujours sur automatic 
 Par défaut pour OS serveurs. 
 Pas pour OS clients. 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
• Les prérequis 
• Les commandes offrant nativement des fonctionnalités d’exécution a 
distance. 
• Les connexions Non-Persistantes 
• Les connexions Persistantes Non-interactives 
• Les connexions Persistantes Interactives 
Powershell 2.0 alphorm.com™©
L’utilisation avancée de Windows PowerShell 
Le travail à grande échelle 
L’exécution en tâche de 
fond : Les jobs 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan 
• Introduction 
•Un « job », c’est quoi ? 
• Les commandes 
Commandes natives 
Cmdlets PowerShell 
Powershell 2.0 alphorm.com™©
Introduction : Dir C: -recurse 
Powershell 2.0 alphorm.com™©
Un job, c’est quoi ? 
• Cela va nous permettre de faire d’éxecuter des commandes en arrière 
plan, et nous libérer le prompt immédiatement. 
• Très utile lorsqu’on utilise des commandes / scripts qui ont besoin de 
beaucoup de temps pour finir 
. 
Powershell 2.0 alphorm.com™©
Les commandes 
• 3 façons de créer un ‘job’ 
 Avec –AsJob 
• Get-WmiObject –Asjob (Execute toujours la commande l’un apres 
l’autre) 
• Invoke-command –AsJob 
• Cmdlet job 
 Start-job –ScriptBlock{…} 
Powershell 2.0 alphorm.com™©
Utilisation: 
• Récupération des résultats: 
• Get-job 
 Retourne le statut actual des jobs. 
• Receive-job 
 Récupère le résultat du job. 
 L’option –keep Permet de garder le retour de la console (Par défaut 
le retour est supprimé). 
Powershell 2.0 alphorm.com™©
Utilisation: 
• Actions sur un job : 
 Get-job 
 Remove-job 
• Supprime un job. 
 Wait-job 
• Attends que le job ce termine. 
 Receive-job 
• Récupère le résultat. 
 Démonstration 
Powershell 2.0 alphorm.com™©
Les jobs enfants 
• Get-job –id JobId ¦ select-object –expand childjobs 
• Démonstration 
Powershell 2.0 alphorm.com™©
Gérer les jobs 
• Il est possible de gerer les jobs en identifiant les jobs parmi une de 
identification suivantes : 
 N° ID 
 Nom du job 
 Piper directement le job vers une des commande de gestion 
• Commandes disponibles 
 Remove-job 
 Stop-Job 
 Wait-job 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
• Synchrone / Asynchrone 
 Différences 
• Les jobs fonctionnent en 3 étapes 
 Lancement du job 
Start-job 
•  Récupérer les résultats / les états des jobs 
• Receive-job 
 Gérer les jobs 
• Get-job, wait-job, remove-job, Stop-Job 
Powershell 2.0 alphorm.com™©
La maîtrise de Windows PowerShell 
Créer ses propres cmdlets 
Le WMI 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan 
• Qu’est ce que le WMI ? 
• A quoi ça vous servir ? 
• Quels sont les prérequis ? 
• Quelques outils indispensables pour gérer le WMI 
• L’architecture WMI en quelques mots 
• PowerShell et le WMI 
Powershell 2.0 alphorm.com™©
Qu’est ce que le WMI ? 
• Windows Management Interface 
 Est l’implémentation Microsoft du modèle de données CIM (Common 
information Model) 
 C’est une modèle de données qui a été créer dans le but de pouvoir manager 
de manière universelle des systèmes divers (PC, Servers, switch, applications 
system d’exploitations etc..) 
• WMI (CIM) permet d’interagir avec n’importe quel système de manière 
standardisé. 
 Existe depuis l’implémentation depuis Windows 2000 sp2 
 Est devenue très facilement accessible avec l’arrivé de PowerShell 
Powershell 2.0 alphorm.com™©
A quoi ça vous servir ? 
• Avoir un control sur les éléments du systèmes offert par des ‘providers’ 
tel qu’une application, la base de registre, ou encore le système 
d’exploitation. 
• Avoir accès a des informations / méthodes supplémentaires de l’OS. 
• Exemple : 
 Access informations du BIOS 
 Possibilité créer de partages 
Powershell 2.0 alphorm.com™©
Quels sont Les prérequis ? 
• Aucun ! 
 Si ce n’est qu’il faut avoir les bons outils pour pouvoir explorer WMI 
Powershell 2.0 alphorm.com™©
Les outils pour explorer le WMI 
• Ils ont tous des noms surprenant ! 
 WMI explorer 
• http://www.ks-soft.net/hostmon.eng/downpage.htm 
 WMI explorer 
• Sapien 
 WMI explorer… ( fait par The powerShell Guy (script powerShell)) 
• http://jdhitsolutions.com/blog/2013/03/wmi-explorer-from-the-powershell- 
guy/ 
 Ou encore… WMI explorer 
• SolarWinds http://www.solarwinds.com/products/freetools/wmi_monitor/ 
Powershell 2.0 alphorm.com™©
WMIExplorer2014 www.sapien.com 
Powershell 2.0 alphorm.com™©
L’architecture WMI en quelques mots 
• Les ‘providers’ offrent des ‘classes’ dans les quels ce trouvent des 
‘instances’. 
 Chaque instance a des propriétés (Nom, Description) 
• Et peut avoir des ‘méthodes’ tel que Stop, start delete etc.. 
• Démonstration de WMI explorer et de l’architecture WMI 
Powershell 2.0 alphorm.com™©
PowerShell et le WMI 
• Les commandes PowerShell disponibles permettant de gérer le WMI 
 Get-WMIObject 
• Retourne des objects de WMI 
 Set-WmiInstance 
• Permet de mettre des valeurs a des propriétées WMI 
 Invoke-WMIMethod 
• Permet d’appeler une méthode (WMI) 
 Remove-WmiObject 
• Permet de supprimer une instance créer de la base WMI 
 Démonstration 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
• Qu’est ce que le WMI ? 
• A quoi ça vous servir ? 
• Quels sont Les prérequis ? 
• Quelques outils indispensables pour gérer le WMI 
• L’architecture WMI en quelques mots 
• PowerShell et le WMI 
 Les commandes WMI 
• .put() 
Powershell 2.0 alphorm.com™©
La maîtrise de Windows PowerShell 
Créer ses propres cmdlets 
L’automatisation d’applications : 
Les objets COM 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan 
• Qu’est ce qu’un objet COM ? 
• A quoi ça vous servir ? 
• PowerShell et les objets COM 
Powershell 2.0 alphorm.com™©
Qu’est ce qu’un objet COM ? 
• Un objet COM est une interface offerte par les fabriquant 
de logiciels afin d’offrir une possibilité d’automatisation sur 
leurs produits 
Powershell 2.0 alphorm.com™©
A quoi ça vous servir ? 
• Les objets COM va permettre d’automatiser des actions au 
sein de programmes connues tel que Word, Internet 
explorer ou bien encore de l’explorateur de fichier. 
Powershell 2.0 alphorm.com™©
PowerShell et les objets COM 
• Comment identifier les objets COM existants ? 
 Registre 
 WMI 
• Comment utiliser un objet COM ? 
 $Variable = New-Object –ComObject NomComObjet 
 $Variable | Get-Member 
• Démonstration 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
• Qu’est ce qu’un objet COM ? 
• A quoi ça vous servir ? 
• PowerShell et les objets COM 
Powershell 2.0 alphorm.com™©
La maîtrise de Windows PowerShell 
Créer ses propres cmdlets 
L’exploitation du DotNet 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Plan 
• Introduction 
• Pourquoi utiliser le .NET 
• Le vocabulaire 
• Comment instancier des objets 
• Notre premier fonction basée sur DotNet 
Powershell 2.0 alphorm.com™©
Introduction 
•Module difficile 
• Il y a beaucoup de vocabulaire liée au développement. Ceci 
dépasse un peu les compétences de base d’un simple 
« scripteur » 
Powershell 2.0 alphorm.com™©
Pourquoi utiliser le .NET ? 
• PowerShell offre beaucoup de cmdlets (236 en PowerShell 2.0) 
• On peut augmenter ce nombre grâce au différents modules 
disponibles (Active Directory, Module Exchange etc..) 
• Des fois, ce n’est pas suffisant 
 
• PowerShell est basé sur du .NET, donc tout ce qui est 
faisable en .NET, on peut le faire en PowerShell. 
Powershell 2.0 alphorm.com™©
Le vocabulaire 
Classe 
L’espace de noms 
NameSpace 
Struct 
Interfaces 
Class 
Methode 
Method 
Propiétes 
Properties 
Class 
Methode 
Method 
Propriétes 
Properties 
Class 
Methode 
Method 
Propiétes 
Properties 
Powershell 2.0 alphorm.com™©
Le vocabulaire 
L’espace de noms 
NameSpace 
Classe 
Contient des classes 
L’équivalent a une sorte 
de modèle qui contiens 
‘des membres’(Méthodes 
 propriétés) 
Class 
Méthode 
Method 
Propriétés 
Properties 
Une méthode retourne 
une valeur, ou le résultat 
d’une opération 
C’est comme une variable 
: cela contient une valeur 
Powershell 2.0 alphorm.com™©
Les classes statiques 
• Les classes statiques n’ont pas besoin d’être ‘instanciées’. (Et 
ne peuvent pas l’être). 
•Méthodes retournant simplement un résultat. 
• C’est la façon ‘facile’ d’utilser le .NET au sein de PowerShell 
• Démonstration 
Powershell 2.0 alphorm.com™©
Comment s’en servir ? 
L’espace de noms 
NameSpace 
Classe 
Instanciation 
Methode 
Class 
Methode 
Method 
Propiétes 
Properties 
Method 
Propiétes 
Properties 
Powershell 2.0 alphorm.com™©
La jungle des classes 
• Comment trouve-t-on les classes / Méthodes / propriétés 
.NET 
 Notre moteur de recherché favoris + msdn (ou .NET) 
Demonstration 
 Powershell 2.0 alphorm.com™©
Les assemblies 
• Une assembly c’est un fichier.DLL qui va contenir des classes, qui vont 
pouvoir êre chargés dans .NET. Ceci dans un but de gain d’éspace 
disque, et de réutilisabilité du code. 
• PowerShell charge beaucoup de composants du framework .NET par 
défaut, mais certains éléments le sont pas. Il est cépendant possible de 
les chargés afin d’avoir accès à leur Classes, méthodes et propriétés via 
powershell. 
Powershell 2.0 alphorm.com™©
Ce qu’on a couvert 
• Introduction 
• Pourquoi utiliser le .NET 
• Le vocabulaire 
 Le framework 
 Les espaces de nom 
 Les classes (static et non static) 
• Méthodes  propriétés 
• Comment instancier des objets 
• Notre premier fonction basée sur DotNet 
Powershell 2.0 alphorm.com™©
Conclusion 
Stéphane van Gulick 
Consultant systèmes et automatisation 
Certifications : MCT, MCITP, MCSA 
Contact : svangulick@alphorm.com 
Twitter : @Stephanevg 
Site : http://www.alphorm.com 
Blog : http://www.ConfigMgrdistrict.com 
Blog : http://www.Powershelldistrict.com 
Forum : http://www.alphorm.com/forum 
Powershell 2.0 alphorm.com™©
Conclusion 
• Regard en arrière 
 Initiation, approfondissement, specialisation 
• Prochaine étapes 
 PowerShell 3.0 
PowerShell lié aux composants MS (Active directory, Exchange, System 
 Center) 
 Scripter le plus possible 
Powershell 2.0 alphorm.com™©
Merci ! 
Powershell 2.0 alphorm.com™©

Más contenido relacionado

La actualidad más candente

Alphorm.com Formation Apache - Le Guide Complet de l'administrateur
Alphorm.com Formation Apache - Le Guide Complet de l'administrateurAlphorm.com Formation Apache - Le Guide Complet de l'administrateur
Alphorm.com Formation Apache - Le Guide Complet de l'administrateurAlphorm
 
Alphorm.com Formation Red Hat RH124
Alphorm.com Formation Red Hat RH124Alphorm.com Formation Red Hat RH124
Alphorm.com Formation Red Hat RH124Alphorm
 
Alphorm.com Support de la formation Mac OS X Server 10.11 El Capitan les fonc...
Alphorm.com Support de la formation Mac OS X Server 10.11 El Capitan les fonc...Alphorm.com Support de la formation Mac OS X Server 10.11 El Capitan les fonc...
Alphorm.com Support de la formation Mac OS X Server 10.11 El Capitan les fonc...Alphorm
 
Alphorm.com Formation PL/SQL
Alphorm.com Formation PL/SQLAlphorm.com Formation PL/SQL
Alphorm.com Formation PL/SQLAlphorm
 
Alphorm formation OS X 10.11 Client El Capitan
Alphorm formation OS X 10.11 Client El CapitanAlphorm formation OS X 10.11 Client El Capitan
Alphorm formation OS X 10.11 Client El CapitanAlphorm
 
alphorm.com - Formation Veeam Backup & Replication 6.5
alphorm.com - Formation Veeam Backup & Replication 6.5alphorm.com - Formation Veeam Backup & Replication 6.5
alphorm.com - Formation Veeam Backup & Replication 6.5Alphorm
 
alphorm.com - Citrix XenServer 6 Administration (A20)
alphorm.com - Citrix XenServer 6 Administration (A20)alphorm.com - Citrix XenServer 6 Administration (A20)
alphorm.com - Citrix XenServer 6 Administration (A20)Alphorm
 
Alphorm.com support-formation-v mware-v-center-6-ss
Alphorm.com support-formation-v mware-v-center-6-ssAlphorm.com support-formation-v mware-v-center-6-ss
Alphorm.com support-formation-v mware-v-center-6-ssAlphorm
 
Alphorm.com Formation Les solutions de Haute Disponibilité sous Windows Serv...
Alphorm.com Formation Les solutions de  Haute Disponibilité sous Windows Serv...Alphorm.com Formation Les solutions de  Haute Disponibilité sous Windows Serv...
Alphorm.com Formation Les solutions de Haute Disponibilité sous Windows Serv...Alphorm
 
Alphorm.com Formation Java Server Faces
Alphorm.com Formation Java Server FacesAlphorm.com Formation Java Server Faces
Alphorm.com Formation Java Server FacesAlphorm
 
Alphorm.com Support de la Formation Azure Iaas avancé 2
Alphorm.com Support de la Formation Azure Iaas avancé 2Alphorm.com Support de la Formation Azure Iaas avancé 2
Alphorm.com Support de la Formation Azure Iaas avancé 2Alphorm
 
alphorm.com - Formation XenSources
alphorm.com - Formation XenSourcesalphorm.com - Formation XenSources
alphorm.com - Formation XenSourcesAlphorm
 
alphorm.com - Formation Configuration de SharePoint 2010 (70-667)
alphorm.com - Formation Configuration de SharePoint 2010 (70-667)alphorm.com - Formation Configuration de SharePoint 2010 (70-667)
alphorm.com - Formation Configuration de SharePoint 2010 (70-667)Alphorm
 
alphorm.com - Formation VMware PowerCLI 5.0
alphorm.com - Formation VMware PowerCLI 5.0alphorm.com - Formation VMware PowerCLI 5.0
alphorm.com - Formation VMware PowerCLI 5.0Alphorm
 
Alphorm.com Formation VirtualBox
Alphorm.com Formation VirtualBoxAlphorm.com Formation VirtualBox
Alphorm.com Formation VirtualBoxAlphorm
 
Alphorm.com support de la formation Drupal 8 webmaster configurateur
Alphorm.com support de la formation Drupal 8 webmaster configurateurAlphorm.com support de la formation Drupal 8 webmaster configurateur
Alphorm.com support de la formation Drupal 8 webmaster configurateurAlphorm
 
Alphorm.com - Formation programmer en Visual Basic .NET
Alphorm.com - Formation programmer en Visual Basic .NETAlphorm.com - Formation programmer en Visual Basic .NET
Alphorm.com - Formation programmer en Visual Basic .NETAlphorm
 
Alphorm.com Support de la Formation VMware vSphere 6, Les machines virtuelles
Alphorm.com Support de la Formation VMware vSphere 6, Les machines virtuellesAlphorm.com Support de la Formation VMware vSphere 6, Les machines virtuelles
Alphorm.com Support de la Formation VMware vSphere 6, Les machines virtuellesAlphorm
 
Alphorm.com Support de la Formation PHP MySQL
Alphorm.com Support de la Formation PHP MySQLAlphorm.com Support de la Formation PHP MySQL
Alphorm.com Support de la Formation PHP MySQLAlphorm
 
Alphorm.com Formation Déployer Xen Desktop 7.6 ET XenApp 7.6
Alphorm.com Formation Déployer Xen Desktop 7.6 ET XenApp 7.6 Alphorm.com Formation Déployer Xen Desktop 7.6 ET XenApp 7.6
Alphorm.com Formation Déployer Xen Desktop 7.6 ET XenApp 7.6 Alphorm
 

La actualidad más candente (20)

Alphorm.com Formation Apache - Le Guide Complet de l'administrateur
Alphorm.com Formation Apache - Le Guide Complet de l'administrateurAlphorm.com Formation Apache - Le Guide Complet de l'administrateur
Alphorm.com Formation Apache - Le Guide Complet de l'administrateur
 
Alphorm.com Formation Red Hat RH124
Alphorm.com Formation Red Hat RH124Alphorm.com Formation Red Hat RH124
Alphorm.com Formation Red Hat RH124
 
Alphorm.com Support de la formation Mac OS X Server 10.11 El Capitan les fonc...
Alphorm.com Support de la formation Mac OS X Server 10.11 El Capitan les fonc...Alphorm.com Support de la formation Mac OS X Server 10.11 El Capitan les fonc...
Alphorm.com Support de la formation Mac OS X Server 10.11 El Capitan les fonc...
 
Alphorm.com Formation PL/SQL
Alphorm.com Formation PL/SQLAlphorm.com Formation PL/SQL
Alphorm.com Formation PL/SQL
 
Alphorm formation OS X 10.11 Client El Capitan
Alphorm formation OS X 10.11 Client El CapitanAlphorm formation OS X 10.11 Client El Capitan
Alphorm formation OS X 10.11 Client El Capitan
 
alphorm.com - Formation Veeam Backup & Replication 6.5
alphorm.com - Formation Veeam Backup & Replication 6.5alphorm.com - Formation Veeam Backup & Replication 6.5
alphorm.com - Formation Veeam Backup & Replication 6.5
 
alphorm.com - Citrix XenServer 6 Administration (A20)
alphorm.com - Citrix XenServer 6 Administration (A20)alphorm.com - Citrix XenServer 6 Administration (A20)
alphorm.com - Citrix XenServer 6 Administration (A20)
 
Alphorm.com support-formation-v mware-v-center-6-ss
Alphorm.com support-formation-v mware-v-center-6-ssAlphorm.com support-formation-v mware-v-center-6-ss
Alphorm.com support-formation-v mware-v-center-6-ss
 
Alphorm.com Formation Les solutions de Haute Disponibilité sous Windows Serv...
Alphorm.com Formation Les solutions de  Haute Disponibilité sous Windows Serv...Alphorm.com Formation Les solutions de  Haute Disponibilité sous Windows Serv...
Alphorm.com Formation Les solutions de Haute Disponibilité sous Windows Serv...
 
Alphorm.com Formation Java Server Faces
Alphorm.com Formation Java Server FacesAlphorm.com Formation Java Server Faces
Alphorm.com Formation Java Server Faces
 
Alphorm.com Support de la Formation Azure Iaas avancé 2
Alphorm.com Support de la Formation Azure Iaas avancé 2Alphorm.com Support de la Formation Azure Iaas avancé 2
Alphorm.com Support de la Formation Azure Iaas avancé 2
 
alphorm.com - Formation XenSources
alphorm.com - Formation XenSourcesalphorm.com - Formation XenSources
alphorm.com - Formation XenSources
 
alphorm.com - Formation Configuration de SharePoint 2010 (70-667)
alphorm.com - Formation Configuration de SharePoint 2010 (70-667)alphorm.com - Formation Configuration de SharePoint 2010 (70-667)
alphorm.com - Formation Configuration de SharePoint 2010 (70-667)
 
alphorm.com - Formation VMware PowerCLI 5.0
alphorm.com - Formation VMware PowerCLI 5.0alphorm.com - Formation VMware PowerCLI 5.0
alphorm.com - Formation VMware PowerCLI 5.0
 
Alphorm.com Formation VirtualBox
Alphorm.com Formation VirtualBoxAlphorm.com Formation VirtualBox
Alphorm.com Formation VirtualBox
 
Alphorm.com support de la formation Drupal 8 webmaster configurateur
Alphorm.com support de la formation Drupal 8 webmaster configurateurAlphorm.com support de la formation Drupal 8 webmaster configurateur
Alphorm.com support de la formation Drupal 8 webmaster configurateur
 
Alphorm.com - Formation programmer en Visual Basic .NET
Alphorm.com - Formation programmer en Visual Basic .NETAlphorm.com - Formation programmer en Visual Basic .NET
Alphorm.com - Formation programmer en Visual Basic .NET
 
Alphorm.com Support de la Formation VMware vSphere 6, Les machines virtuelles
Alphorm.com Support de la Formation VMware vSphere 6, Les machines virtuellesAlphorm.com Support de la Formation VMware vSphere 6, Les machines virtuelles
Alphorm.com Support de la Formation VMware vSphere 6, Les machines virtuelles
 
Alphorm.com Support de la Formation PHP MySQL
Alphorm.com Support de la Formation PHP MySQLAlphorm.com Support de la Formation PHP MySQL
Alphorm.com Support de la Formation PHP MySQL
 
Alphorm.com Formation Déployer Xen Desktop 7.6 ET XenApp 7.6
Alphorm.com Formation Déployer Xen Desktop 7.6 ET XenApp 7.6 Alphorm.com Formation Déployer Xen Desktop 7.6 ET XenApp 7.6
Alphorm.com Formation Déployer Xen Desktop 7.6 ET XenApp 7.6
 

Destacado

Alphorm.com Formation Implémenter une PKI avec ADCS 2012 R2
Alphorm.com Formation Implémenter une PKI avec ADCS 2012 R2 Alphorm.com Formation Implémenter une PKI avec ADCS 2012 R2
Alphorm.com Formation Implémenter une PKI avec ADCS 2012 R2 Alphorm
 
Alphorm.com Formation SOPHOS XG FIREWALL, Administration
Alphorm.com Formation SOPHOS XG FIREWALL, AdministrationAlphorm.com Formation SOPHOS XG FIREWALL, Administration
Alphorm.com Formation SOPHOS XG FIREWALL, AdministrationAlphorm
 
Alphorm.com Formation Exchange 2016, Configuration Avancée
Alphorm.com Formation Exchange 2016, Configuration AvancéeAlphorm.com Formation Exchange 2016, Configuration Avancée
Alphorm.com Formation Exchange 2016, Configuration AvancéeAlphorm
 
Alphorm.com Formation SCCM 2012 R2
Alphorm.com Formation SCCM 2012 R2Alphorm.com Formation SCCM 2012 R2
Alphorm.com Formation SCCM 2012 R2Alphorm
 
Alphorm.com Formation Excel 2016 Expert I - partie 1
Alphorm.com Formation Excel 2016 Expert I - partie 1Alphorm.com Formation Excel 2016 Expert I - partie 1
Alphorm.com Formation Excel 2016 Expert I - partie 1Alphorm
 
Alphorm.com Formation VMware Horizon View 5.2
Alphorm.com Formation VMware Horizon View 5.2Alphorm.com Formation VMware Horizon View 5.2
Alphorm.com Formation VMware Horizon View 5.2Alphorm
 
Alphorm.com Microsoft AZURE
Alphorm.com Microsoft AZUREAlphorm.com Microsoft AZURE
Alphorm.com Microsoft AZUREAlphorm
 
Alphorm.com Support de la Formation MDT 2013 Update 2 : Maîtrisez le déploiem...
Alphorm.com Support de la Formation MDT 2013 Update 2 : Maîtrisez le déploiem...Alphorm.com Support de la Formation MDT 2013 Update 2 : Maîtrisez le déploiem...
Alphorm.com Support de la Formation MDT 2013 Update 2 : Maîtrisez le déploiem...Alphorm
 
Alphorm.com Support de la Formation Stormshield Administration
Alphorm.com Support de la Formation Stormshield AdministrationAlphorm.com Support de la Formation Stormshield Administration
Alphorm.com Support de la Formation Stormshield AdministrationAlphorm
 
Alphorm.com-Formation windows phone 8.1
Alphorm.com-Formation windows phone 8.1Alphorm.com-Formation windows phone 8.1
Alphorm.com-Formation windows phone 8.1Alphorm
 
alphorm.com - Formation Programmer en C++
alphorm.com - Formation Programmer en C++alphorm.com - Formation Programmer en C++
alphorm.com - Formation Programmer en C++Alphorm
 
Alphorm.com Formation VMware Workstation 11
Alphorm.com Formation VMware Workstation 11 Alphorm.com Formation VMware Workstation 11
Alphorm.com Formation VMware Workstation 11 Alphorm
 
Alphorm.com Formation les fondamentaux de Matlab 2013 A
Alphorm.com  Formation les fondamentaux de Matlab 2013 AAlphorm.com  Formation les fondamentaux de Matlab 2013 A
Alphorm.com Formation les fondamentaux de Matlab 2013 AAlphorm
 
Alphorm.com Formation Référencement naturel SEO
Alphorm.com Formation Référencement naturel SEOAlphorm.com Formation Référencement naturel SEO
Alphorm.com Formation Référencement naturel SEOAlphorm
 
Alphorm.com support Formation Windows 10 Déploiement et administration
Alphorm.com support Formation Windows 10 Déploiement et administrationAlphorm.com support Formation Windows 10 Déploiement et administration
Alphorm.com support Formation Windows 10 Déploiement et administrationAlphorm
 
Alphorm.com Support de la Formation Azure IAAS avancé 1
Alphorm.com Support de la Formation Azure IAAS avancé 1Alphorm.com Support de la Formation Azure IAAS avancé 1
Alphorm.com Support de la Formation Azure IAAS avancé 1Alphorm
 
alphorm.com - Formation Microsoft Hyper-V 2012
alphorm.com - Formation Microsoft Hyper-V 2012alphorm.com - Formation Microsoft Hyper-V 2012
alphorm.com - Formation Microsoft Hyper-V 2012Alphorm
 
Alphorm.com Support de la Formation Symfony 3 , les fondamentaux-ss
Alphorm.com Support de la Formation Symfony 3 , les fondamentaux-ssAlphorm.com Support de la Formation Symfony 3 , les fondamentaux-ss
Alphorm.com Support de la Formation Symfony 3 , les fondamentaux-ssAlphorm
 
Alphorm.com-Formation MongoDB Administration
Alphorm.com-Formation MongoDB AdministrationAlphorm.com-Formation MongoDB Administration
Alphorm.com-Formation MongoDB AdministrationAlphorm
 
alphorm.com - Formation Exchange Server 2013 (70-341)
alphorm.com - Formation Exchange Server 2013 (70-341)alphorm.com - Formation Exchange Server 2013 (70-341)
alphorm.com - Formation Exchange Server 2013 (70-341)Alphorm
 

Destacado (20)

Alphorm.com Formation Implémenter une PKI avec ADCS 2012 R2
Alphorm.com Formation Implémenter une PKI avec ADCS 2012 R2 Alphorm.com Formation Implémenter une PKI avec ADCS 2012 R2
Alphorm.com Formation Implémenter une PKI avec ADCS 2012 R2
 
Alphorm.com Formation SOPHOS XG FIREWALL, Administration
Alphorm.com Formation SOPHOS XG FIREWALL, AdministrationAlphorm.com Formation SOPHOS XG FIREWALL, Administration
Alphorm.com Formation SOPHOS XG FIREWALL, Administration
 
Alphorm.com Formation Exchange 2016, Configuration Avancée
Alphorm.com Formation Exchange 2016, Configuration AvancéeAlphorm.com Formation Exchange 2016, Configuration Avancée
Alphorm.com Formation Exchange 2016, Configuration Avancée
 
Alphorm.com Formation SCCM 2012 R2
Alphorm.com Formation SCCM 2012 R2Alphorm.com Formation SCCM 2012 R2
Alphorm.com Formation SCCM 2012 R2
 
Alphorm.com Formation Excel 2016 Expert I - partie 1
Alphorm.com Formation Excel 2016 Expert I - partie 1Alphorm.com Formation Excel 2016 Expert I - partie 1
Alphorm.com Formation Excel 2016 Expert I - partie 1
 
Alphorm.com Formation VMware Horizon View 5.2
Alphorm.com Formation VMware Horizon View 5.2Alphorm.com Formation VMware Horizon View 5.2
Alphorm.com Formation VMware Horizon View 5.2
 
Alphorm.com Microsoft AZURE
Alphorm.com Microsoft AZUREAlphorm.com Microsoft AZURE
Alphorm.com Microsoft AZURE
 
Alphorm.com Support de la Formation MDT 2013 Update 2 : Maîtrisez le déploiem...
Alphorm.com Support de la Formation MDT 2013 Update 2 : Maîtrisez le déploiem...Alphorm.com Support de la Formation MDT 2013 Update 2 : Maîtrisez le déploiem...
Alphorm.com Support de la Formation MDT 2013 Update 2 : Maîtrisez le déploiem...
 
Alphorm.com Support de la Formation Stormshield Administration
Alphorm.com Support de la Formation Stormshield AdministrationAlphorm.com Support de la Formation Stormshield Administration
Alphorm.com Support de la Formation Stormshield Administration
 
Alphorm.com-Formation windows phone 8.1
Alphorm.com-Formation windows phone 8.1Alphorm.com-Formation windows phone 8.1
Alphorm.com-Formation windows phone 8.1
 
alphorm.com - Formation Programmer en C++
alphorm.com - Formation Programmer en C++alphorm.com - Formation Programmer en C++
alphorm.com - Formation Programmer en C++
 
Alphorm.com Formation VMware Workstation 11
Alphorm.com Formation VMware Workstation 11 Alphorm.com Formation VMware Workstation 11
Alphorm.com Formation VMware Workstation 11
 
Alphorm.com Formation les fondamentaux de Matlab 2013 A
Alphorm.com  Formation les fondamentaux de Matlab 2013 AAlphorm.com  Formation les fondamentaux de Matlab 2013 A
Alphorm.com Formation les fondamentaux de Matlab 2013 A
 
Alphorm.com Formation Référencement naturel SEO
Alphorm.com Formation Référencement naturel SEOAlphorm.com Formation Référencement naturel SEO
Alphorm.com Formation Référencement naturel SEO
 
Alphorm.com support Formation Windows 10 Déploiement et administration
Alphorm.com support Formation Windows 10 Déploiement et administrationAlphorm.com support Formation Windows 10 Déploiement et administration
Alphorm.com support Formation Windows 10 Déploiement et administration
 
Alphorm.com Support de la Formation Azure IAAS avancé 1
Alphorm.com Support de la Formation Azure IAAS avancé 1Alphorm.com Support de la Formation Azure IAAS avancé 1
Alphorm.com Support de la Formation Azure IAAS avancé 1
 
alphorm.com - Formation Microsoft Hyper-V 2012
alphorm.com - Formation Microsoft Hyper-V 2012alphorm.com - Formation Microsoft Hyper-V 2012
alphorm.com - Formation Microsoft Hyper-V 2012
 
Alphorm.com Support de la Formation Symfony 3 , les fondamentaux-ss
Alphorm.com Support de la Formation Symfony 3 , les fondamentaux-ssAlphorm.com Support de la Formation Symfony 3 , les fondamentaux-ss
Alphorm.com Support de la Formation Symfony 3 , les fondamentaux-ss
 
Alphorm.com-Formation MongoDB Administration
Alphorm.com-Formation MongoDB AdministrationAlphorm.com-Formation MongoDB Administration
Alphorm.com-Formation MongoDB Administration
 
alphorm.com - Formation Exchange Server 2013 (70-341)
alphorm.com - Formation Exchange Server 2013 (70-341)alphorm.com - Formation Exchange Server 2013 (70-341)
alphorm.com - Formation Exchange Server 2013 (70-341)
 

Similar a alphorm.com - Formation Powershell 2.0

2008-09-30 Administration automatisée avec Powershell
2008-09-30 Administration automatisée avec Powershell2008-09-30 Administration automatisée avec Powershell
2008-09-30 Administration automatisée avec PowershellPatrick Guimonet
 
PowerShell - Retours d'expériences
PowerShell - Retours d'expériencesPowerShell - Retours d'expériences
PowerShell - Retours d'expériencesRan Mellul
 
Powershell
PowershellPowershell
PowershellUGAIA
 
La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !
La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !
La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !Paris Salesforce Developer Group
 
Power Shell V2 en action - avec Posh Board 2.0
Power Shell V2 en action - avec Posh Board 2.0Power Shell V2 en action - avec Posh Board 2.0
Power Shell V2 en action - avec Posh Board 2.0Patrick Guimonet
 
M10961 formation-automatiser-l-administration-windows-avec-microsoft-powershe...
M10961 formation-automatiser-l-administration-windows-avec-microsoft-powershe...M10961 formation-automatiser-l-administration-windows-avec-microsoft-powershe...
M10961 formation-automatiser-l-administration-windows-avec-microsoft-powershe...CERTyou Formation
 
Utilisation optimale et professionnelle de PHP
Utilisation optimale et professionnelle de PHPUtilisation optimale et professionnelle de PHP
Utilisation optimale et professionnelle de PHPJean-Marc Fontaine
 
Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...
Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...
Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...Franck Cornu
 
Alphorm.com Formation Windows Server 2016 : Installation et Configuration
Alphorm.com Formation Windows Server 2016 : Installation et ConfigurationAlphorm.com Formation Windows Server 2016 : Installation et Configuration
Alphorm.com Formation Windows Server 2016 : Installation et ConfigurationAlphorm
 
Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...
Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...
Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...GSoft
 
Soutenance Zend Framework vs Symfony
Soutenance Zend Framework vs SymfonySoutenance Zend Framework vs Symfony
Soutenance Zend Framework vs SymfonyVincent Composieux
 
ALT.Net Juin 2012 - Specflow
ALT.Net Juin 2012 - SpecflowALT.Net Juin 2012 - Specflow
ALT.Net Juin 2012 - SpecflowMathias Kluba
 
Rich Desktop Applications
Rich Desktop ApplicationsRich Desktop Applications
Rich Desktop Applicationsgoldoraf
 
Presentation Spring, Spring MVC
Presentation Spring, Spring MVCPresentation Spring, Spring MVC
Presentation Spring, Spring MVCNathaniel Richand
 

Similar a alphorm.com - Formation Powershell 2.0 (20)

2008-09-30 Administration automatisée avec Powershell
2008-09-30 Administration automatisée avec Powershell2008-09-30 Administration automatisée avec Powershell
2008-09-30 Administration automatisée avec Powershell
 
Les nouveautés de PowerShell 3.0
Les nouveautés de PowerShell 3.0Les nouveautés de PowerShell 3.0
Les nouveautés de PowerShell 3.0
 
PowerShell - Retours d'expériences
PowerShell - Retours d'expériencesPowerShell - Retours d'expériences
PowerShell - Retours d'expériences
 
Powershell
PowershellPowershell
Powershell
 
Retour d'expérience sur PowerShell
Retour d'expérience sur PowerShellRetour d'expérience sur PowerShell
Retour d'expérience sur PowerShell
 
Powershell overview
Powershell overviewPowershell overview
Powershell overview
 
La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !
La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !
La Tooling API, est-ce pour moi ? Bien sûr, viens voir pourquoi !
 
Php seance1
Php seance1Php seance1
Php seance1
 
Power Shell V2 en action - avec Posh Board 2.0
Power Shell V2 en action - avec Posh Board 2.0Power Shell V2 en action - avec Posh Board 2.0
Power Shell V2 en action - avec Posh Board 2.0
 
M10961 formation-automatiser-l-administration-windows-avec-microsoft-powershe...
M10961 formation-automatiser-l-administration-windows-avec-microsoft-powershe...M10961 formation-automatiser-l-administration-windows-avec-microsoft-powershe...
M10961 formation-automatiser-l-administration-windows-avec-microsoft-powershe...
 
Utilisation optimale et professionnelle de PHP
Utilisation optimale et professionnelle de PHPUtilisation optimale et professionnelle de PHP
Utilisation optimale et professionnelle de PHP
 
Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...
Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...
Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...
 
Alphorm.com Formation Windows Server 2016 : Installation et Configuration
Alphorm.com Formation Windows Server 2016 : Installation et ConfigurationAlphorm.com Formation Windows Server 2016 : Installation et Configuration
Alphorm.com Formation Windows Server 2016 : Installation et Configuration
 
Des tests modernes pour Drupal
Des tests modernes pour DrupalDes tests modernes pour Drupal
Des tests modernes pour Drupal
 
Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...
Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...
Automatiser le déploiement d'environnements SharePoint 2010/2013 grâce à Powe...
 
Soutenance Zend Framework vs Symfony
Soutenance Zend Framework vs SymfonySoutenance Zend Framework vs Symfony
Soutenance Zend Framework vs Symfony
 
ALT.Net Juin 2012 - Specflow
ALT.Net Juin 2012 - SpecflowALT.Net Juin 2012 - Specflow
ALT.Net Juin 2012 - Specflow
 
Rich Desktop Applications
Rich Desktop ApplicationsRich Desktop Applications
Rich Desktop Applications
 
Power Shell V2 Full
Power Shell V2 FullPower Shell V2 Full
Power Shell V2 Full
 
Presentation Spring, Spring MVC
Presentation Spring, Spring MVCPresentation Spring, Spring MVC
Presentation Spring, Spring MVC
 

Más de Alphorm

Alphorm.com Formation Microsoft 365 (MS-500) : Administrateur Sécurité - Prot...
Alphorm.com Formation Microsoft 365 (MS-500) : Administrateur Sécurité - Prot...Alphorm.com Formation Microsoft 365 (MS-500) : Administrateur Sécurité - Prot...
Alphorm.com Formation Microsoft 365 (MS-500) : Administrateur Sécurité - Prot...Alphorm
 
Alphorm.com Formation Google Sheets : Créer un Tableau de Bord Collaboratif a...
Alphorm.com Formation Google Sheets : Créer un Tableau de Bord Collaboratif a...Alphorm.com Formation Google Sheets : Créer un Tableau de Bord Collaboratif a...
Alphorm.com Formation Google Sheets : Créer un Tableau de Bord Collaboratif a...Alphorm
 
Alphorm.com Formation CCNP ENCOR 350-401 (6of8) : Sécurité
Alphorm.com Formation CCNP ENCOR 350-401 (6of8) : SécuritéAlphorm.com Formation CCNP ENCOR 350-401 (6of8) : Sécurité
Alphorm.com Formation CCNP ENCOR 350-401 (6of8) : SécuritéAlphorm
 
Alphorm.com Formation Vue JS 3 : Créer une application de A à Z
Alphorm.com Formation Vue JS 3 : Créer une application de A à ZAlphorm.com Formation Vue JS 3 : Créer une application de A à Z
Alphorm.com Formation Vue JS 3 : Créer une application de A à ZAlphorm
 
Alphorm.com Formation Blockchain : Maîtriser la Conception d'Architectures
Alphorm.com Formation Blockchain : Maîtriser la Conception d'ArchitecturesAlphorm.com Formation Blockchain : Maîtriser la Conception d'Architectures
Alphorm.com Formation Blockchain : Maîtriser la Conception d'ArchitecturesAlphorm
 
Alphorm.com Formation Sage : Gestion Commerciale
Alphorm.com Formation Sage : Gestion CommercialeAlphorm.com Formation Sage : Gestion Commerciale
Alphorm.com Formation Sage : Gestion CommercialeAlphorm
 
Alphorm.com Formation PHP 8 (2/6) : L'héritage en orienté objet
Alphorm.com Formation PHP 8 (2/6) : L'héritage en orienté objetAlphorm.com Formation PHP 8 (2/6) : L'héritage en orienté objet
Alphorm.com Formation PHP 8 (2/6) : L'héritage en orienté objetAlphorm
 
Alphorm.com Formation Excel 2019 : Concevoir un Tableau de Bord Interactif
Alphorm.com Formation Excel 2019 : Concevoir un Tableau de Bord InteractifAlphorm.com Formation Excel 2019 : Concevoir un Tableau de Bord Interactif
Alphorm.com Formation Excel 2019 : Concevoir un Tableau de Bord InteractifAlphorm
 
Alphorm.com Formation Maya 3D : Créer un Design d'intérieur au Style Isométrique
Alphorm.com Formation Maya 3D : Créer un Design d'intérieur au Style IsométriqueAlphorm.com Formation Maya 3D : Créer un Design d'intérieur au Style Isométrique
Alphorm.com Formation Maya 3D : Créer un Design d'intérieur au Style IsométriqueAlphorm
 
Alphorm.com Formation VMware vSphere 7 : La Mise à Niveau
Alphorm.com Formation VMware vSphere 7 : La Mise à NiveauAlphorm.com Formation VMware vSphere 7 : La Mise à Niveau
Alphorm.com Formation VMware vSphere 7 : La Mise à NiveauAlphorm
 
Alphorm.com Formation Apprendre les bonnes pratiques de CSS avec BEM : OOCSS ...
Alphorm.com Formation Apprendre les bonnes pratiques de CSS avec BEM : OOCSS ...Alphorm.com Formation Apprendre les bonnes pratiques de CSS avec BEM : OOCSS ...
Alphorm.com Formation Apprendre les bonnes pratiques de CSS avec BEM : OOCSS ...Alphorm
 
Alphorm.com Formation Unity : Monétiser votre jeu 3D sur les plateformes Mobiles
Alphorm.com Formation Unity : Monétiser votre jeu 3D sur les plateformes MobilesAlphorm.com Formation Unity : Monétiser votre jeu 3D sur les plateformes Mobiles
Alphorm.com Formation Unity : Monétiser votre jeu 3D sur les plateformes MobilesAlphorm
 
Alphorm.com Formation PHP 8 : Les bases de la POO
Alphorm.com Formation PHP 8 : Les bases de la POOAlphorm.com Formation PHP 8 : Les bases de la POO
Alphorm.com Formation PHP 8 : Les bases de la POOAlphorm
 
Alphorm.com Formation Power BI : Transformation de Données avec DAX et Power ...
Alphorm.com Formation Power BI : Transformation de Données avec DAX et Power ...Alphorm.com Formation Power BI : Transformation de Données avec DAX et Power ...
Alphorm.com Formation Power BI : Transformation de Données avec DAX et Power ...Alphorm
 
Alphorm.com Formation Techniques de Blue Teaming : L'Essentiel pour l'Analyst...
Alphorm.com Formation Techniques de Blue Teaming : L'Essentiel pour l'Analyst...Alphorm.com Formation Techniques de Blue Teaming : L'Essentiel pour l'Analyst...
Alphorm.com Formation Techniques de Blue Teaming : L'Essentiel pour l'Analyst...Alphorm
 
Alphorm.com Formation Améliorer le développement avec CSS-in-JS _ Styled Comp...
Alphorm.com Formation Améliorer le développement avec CSS-in-JS _ Styled Comp...Alphorm.com Formation Améliorer le développement avec CSS-in-JS _ Styled Comp...
Alphorm.com Formation Améliorer le développement avec CSS-in-JS _ Styled Comp...Alphorm
 
Alphorm.com Formation Unity (6/7) : Maitriser l'Intelligence Artificielle de ...
Alphorm.com Formation Unity (6/7) : Maitriser l'Intelligence Artificielle de ...Alphorm.com Formation Unity (6/7) : Maitriser l'Intelligence Artificielle de ...
Alphorm.com Formation Unity (6/7) : Maitriser l'Intelligence Artificielle de ...Alphorm
 
Alphorm.com Formation Architecture Microservices : Jenkins et SpringBoot
Alphorm.com Formation Architecture Microservices : Jenkins et SpringBootAlphorm.com Formation Architecture Microservices : Jenkins et SpringBoot
Alphorm.com Formation Architecture Microservices : Jenkins et SpringBootAlphorm
 
Alphorm.com Formation Active Directory 2022 : Multi Sites et Services
Alphorm.com Formation Active Directory 2022 : Multi Sites et ServicesAlphorm.com Formation Active Directory 2022 : Multi Sites et Services
Alphorm.com Formation Active Directory 2022 : Multi Sites et ServicesAlphorm
 
Alphorm.com Formation Vue JS 3 : Exploiter la Composition API
Alphorm.com Formation Vue JS 3 : Exploiter la Composition APIAlphorm.com Formation Vue JS 3 : Exploiter la Composition API
Alphorm.com Formation Vue JS 3 : Exploiter la Composition APIAlphorm
 

Más de Alphorm (20)

Alphorm.com Formation Microsoft 365 (MS-500) : Administrateur Sécurité - Prot...
Alphorm.com Formation Microsoft 365 (MS-500) : Administrateur Sécurité - Prot...Alphorm.com Formation Microsoft 365 (MS-500) : Administrateur Sécurité - Prot...
Alphorm.com Formation Microsoft 365 (MS-500) : Administrateur Sécurité - Prot...
 
Alphorm.com Formation Google Sheets : Créer un Tableau de Bord Collaboratif a...
Alphorm.com Formation Google Sheets : Créer un Tableau de Bord Collaboratif a...Alphorm.com Formation Google Sheets : Créer un Tableau de Bord Collaboratif a...
Alphorm.com Formation Google Sheets : Créer un Tableau de Bord Collaboratif a...
 
Alphorm.com Formation CCNP ENCOR 350-401 (6of8) : Sécurité
Alphorm.com Formation CCNP ENCOR 350-401 (6of8) : SécuritéAlphorm.com Formation CCNP ENCOR 350-401 (6of8) : Sécurité
Alphorm.com Formation CCNP ENCOR 350-401 (6of8) : Sécurité
 
Alphorm.com Formation Vue JS 3 : Créer une application de A à Z
Alphorm.com Formation Vue JS 3 : Créer une application de A à ZAlphorm.com Formation Vue JS 3 : Créer une application de A à Z
Alphorm.com Formation Vue JS 3 : Créer une application de A à Z
 
Alphorm.com Formation Blockchain : Maîtriser la Conception d'Architectures
Alphorm.com Formation Blockchain : Maîtriser la Conception d'ArchitecturesAlphorm.com Formation Blockchain : Maîtriser la Conception d'Architectures
Alphorm.com Formation Blockchain : Maîtriser la Conception d'Architectures
 
Alphorm.com Formation Sage : Gestion Commerciale
Alphorm.com Formation Sage : Gestion CommercialeAlphorm.com Formation Sage : Gestion Commerciale
Alphorm.com Formation Sage : Gestion Commerciale
 
Alphorm.com Formation PHP 8 (2/6) : L'héritage en orienté objet
Alphorm.com Formation PHP 8 (2/6) : L'héritage en orienté objetAlphorm.com Formation PHP 8 (2/6) : L'héritage en orienté objet
Alphorm.com Formation PHP 8 (2/6) : L'héritage en orienté objet
 
Alphorm.com Formation Excel 2019 : Concevoir un Tableau de Bord Interactif
Alphorm.com Formation Excel 2019 : Concevoir un Tableau de Bord InteractifAlphorm.com Formation Excel 2019 : Concevoir un Tableau de Bord Interactif
Alphorm.com Formation Excel 2019 : Concevoir un Tableau de Bord Interactif
 
Alphorm.com Formation Maya 3D : Créer un Design d'intérieur au Style Isométrique
Alphorm.com Formation Maya 3D : Créer un Design d'intérieur au Style IsométriqueAlphorm.com Formation Maya 3D : Créer un Design d'intérieur au Style Isométrique
Alphorm.com Formation Maya 3D : Créer un Design d'intérieur au Style Isométrique
 
Alphorm.com Formation VMware vSphere 7 : La Mise à Niveau
Alphorm.com Formation VMware vSphere 7 : La Mise à NiveauAlphorm.com Formation VMware vSphere 7 : La Mise à Niveau
Alphorm.com Formation VMware vSphere 7 : La Mise à Niveau
 
Alphorm.com Formation Apprendre les bonnes pratiques de CSS avec BEM : OOCSS ...
Alphorm.com Formation Apprendre les bonnes pratiques de CSS avec BEM : OOCSS ...Alphorm.com Formation Apprendre les bonnes pratiques de CSS avec BEM : OOCSS ...
Alphorm.com Formation Apprendre les bonnes pratiques de CSS avec BEM : OOCSS ...
 
Alphorm.com Formation Unity : Monétiser votre jeu 3D sur les plateformes Mobiles
Alphorm.com Formation Unity : Monétiser votre jeu 3D sur les plateformes MobilesAlphorm.com Formation Unity : Monétiser votre jeu 3D sur les plateformes Mobiles
Alphorm.com Formation Unity : Monétiser votre jeu 3D sur les plateformes Mobiles
 
Alphorm.com Formation PHP 8 : Les bases de la POO
Alphorm.com Formation PHP 8 : Les bases de la POOAlphorm.com Formation PHP 8 : Les bases de la POO
Alphorm.com Formation PHP 8 : Les bases de la POO
 
Alphorm.com Formation Power BI : Transformation de Données avec DAX et Power ...
Alphorm.com Formation Power BI : Transformation de Données avec DAX et Power ...Alphorm.com Formation Power BI : Transformation de Données avec DAX et Power ...
Alphorm.com Formation Power BI : Transformation de Données avec DAX et Power ...
 
Alphorm.com Formation Techniques de Blue Teaming : L'Essentiel pour l'Analyst...
Alphorm.com Formation Techniques de Blue Teaming : L'Essentiel pour l'Analyst...Alphorm.com Formation Techniques de Blue Teaming : L'Essentiel pour l'Analyst...
Alphorm.com Formation Techniques de Blue Teaming : L'Essentiel pour l'Analyst...
 
Alphorm.com Formation Améliorer le développement avec CSS-in-JS _ Styled Comp...
Alphorm.com Formation Améliorer le développement avec CSS-in-JS _ Styled Comp...Alphorm.com Formation Améliorer le développement avec CSS-in-JS _ Styled Comp...
Alphorm.com Formation Améliorer le développement avec CSS-in-JS _ Styled Comp...
 
Alphorm.com Formation Unity (6/7) : Maitriser l'Intelligence Artificielle de ...
Alphorm.com Formation Unity (6/7) : Maitriser l'Intelligence Artificielle de ...Alphorm.com Formation Unity (6/7) : Maitriser l'Intelligence Artificielle de ...
Alphorm.com Formation Unity (6/7) : Maitriser l'Intelligence Artificielle de ...
 
Alphorm.com Formation Architecture Microservices : Jenkins et SpringBoot
Alphorm.com Formation Architecture Microservices : Jenkins et SpringBootAlphorm.com Formation Architecture Microservices : Jenkins et SpringBoot
Alphorm.com Formation Architecture Microservices : Jenkins et SpringBoot
 
Alphorm.com Formation Active Directory 2022 : Multi Sites et Services
Alphorm.com Formation Active Directory 2022 : Multi Sites et ServicesAlphorm.com Formation Active Directory 2022 : Multi Sites et Services
Alphorm.com Formation Active Directory 2022 : Multi Sites et Services
 
Alphorm.com Formation Vue JS 3 : Exploiter la Composition API
Alphorm.com Formation Vue JS 3 : Exploiter la Composition APIAlphorm.com Formation Vue JS 3 : Exploiter la Composition API
Alphorm.com Formation Vue JS 3 : Exploiter la Composition API
 

alphorm.com - Formation Powershell 2.0

  • 1. Présentation de la formation Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Powershell 2.0 alphorm.com™©
  • 2. Introduction Powershell 2.0 alphorm.com™©
  • 3. Plan • Présentation du formateur. • Prérequis de cette formation. • Quelques références. • Présentation de la formation. Powershell 2.0 alphorm.com™©
  • 4. Présentation du formateur • Présentation • Stéphane van Gulick Ingénieur Systèmes et automatisation MCTS, MCITP EA, MCSA Blog : http://PowerShellDistrict.com Twitter : @stephanevg Powershell 2.0 alphorm.com™©
  • 5. Prérequis de cette formation Connaissances des systèmes Windows Une expérience en Scripting est un plus. (Mais pas obligatoire !) Compréhension de principes algorithmiques (tel que les « IF, ELSE, FOREACH) etc.. Être motivé et enthousiaste ! Lab: • 1 machine Windows 7 • (une deuxième machine windows 7 pour le chapitre sur le remoting). Powershell 2.0 alphorm.com™©
  • 6. Quelques références • Version CHM de l’aide PowerShell http://www.microsoft.com/en-us/ download/details.aspx?id=10552 • Script center http://technet.microsoft.com/en-us/scriptcenter/ • Blog Scripting Guy http://blogs.technet.com/b/heyscriptingguy/ • Livres - Windows PowerShell Guide de référence PowerShell in Action Powershell 2.0 alphorm.com™©
  • 7. Présentation de la formation 3 grandes parties Chapitres Modules Powershell 2.0 alphorm.com™©
  • 8. Présentation de la formation 1. L’initiation au PowerShell 2.0 Chapitre 1 : Introduction à PowerShell 1. Présentation de la formation 2. Introduction générale a Windows PowerShell Chapitre 2 : L’apprentissage de PowerShell 1. Introduction au langage 2. Opérateurs et expressions 3. La gestion du flux (l’utilisation du pipe) 4. Importer des données depuis des supports externes. Powershell 2.0 alphorm.com™©
  • 9. Présentation de la formation • Partie 2 : L’utilisation avancé de PowerShell 2.0 Chapitre 3 L’utilisation avancé de PowerShell : Le scripting 1. Les fonctions et les filtres 2. La gestion d’erreur 3. Les fonctions avancées Chapitre 4 : La maitrise de PowerShell en travaillant à grande échelle 1. Les modules 2. L’execution à distance 3. L’execution en tâche de fond : “Les jobs” Powershell 2.0 alphorm.com™©
  • 10. Présentation de la formation Partie 3 : Maîtrise de PowerShell 2.0 Chapitre 5: Créer ses propres cmdlets • Le WMI • L’automatisation d’applications (Com objects) • L’exploitation du dotnet Conclusion Powershell 2.0 alphorm.com™©
  • 11. Are you ready ? ☺ Let’s GO ! Powershell 2.0 alphorm.com™©
  • 12. Initiation à PowerShell Introduction à Windows PowerShell Introduction générale à Windows PowerShell Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 13. Plan 1. Qu’est-ce PowerShell ? 2. Les différents versions existantes de PowerShell. 3. Prérequis nécessaire pour l’installation / l’utilisation de PowerShell. 4. Présentation du prompt, et de l’environnement de Scripting intégré. 5. Découverte des premières commandes. Powershell 2.0 alphorm.com™©
  • 14. Les avantages à utiliser Windows PowerShell ? Automatisation de tâches récurrentes / répétitives. Réduit le temps d’effort nécessaire pour l’accomplissement de cette tâche. Permet de paralléliser plusieurs tâches à la fois. Réduit la probabilité d’erreur. Possibilité de déléguer une tâche plus facilement. Est idéal pour la réutilisabilité. Permet d’aller au-delà des limites des interface graphiques. Powershell 2.0 alphorm.com™©
  • 15. Présence de Windows PowerShell Système d’éxploitation PowerShell 2.0 Windows XP PowerShell 2.0 (Facultatif) Windows Server 2003 PowerShell 2.0 (Facultatif) Windows Vista PowerShell 2.0 (Facultatif) Windows 7 PowerShell 2.0 (Natif) Windows Server 2008 PowerShell 2.0 (Natif) Windows 8 PowerShell 3.0 (Natif) Windows Server 2012 PowerShell 3.0 (Natif) Windows 8.1 PowerShell 4.0 (Natif) Windows Server 2012 R2 PowerShell 4.0 (Natif) Powershell 2.0 alphorm.com™©
  • 16. Prérequis à l’installation de Windows PowerShell Powershell Windows Management framework Prérequis Lien 2.0 WMF 2.0 Dotnet 2.0 http://support.microsoft.com/k b/968929/fr 3.0 WMF 3.0 Dotnet 3.5 http://support.microsoft.com/k b/2506143/fr 4.0 WMF 4.0 Dotnet 4.5 http://www.microsoft.com/fr-fr/ download/details.aspx?id=4 0855 Powershell 2.0 alphorm.com™©
  • 17. Découverte de la console PowerShell + ISE Prompt PowerShell Console ISE Powershell 2.0 alphorm.com™©
  • 18. Prompt – Récapitulatif Commande Résultat F1 Réécris la dernière commande lettre par lettre. F3 Auto complète une commande. F4 Supprime jusqu’au curseur. F5 Remonte dans l’historique des commandes. F7 Affiche l’historique des commandes. (CTRL+F7 l’efface) Commande Résultat Alt+ espace +E Navigue vers menu édition. CTRL+C Cesse l’exécution de la commande en cours. CTRL+S Pause l’affichage en cours. CTRL + end Supprime tout depuis le curseur. F8 Auto complète votre ligne avec votre historique. F9 Spécifie une ligne de l’historique précise (F7) Tab / Shift + tab Auto complète votre commande. Flèche haut / bas Navigue dans l’historique des commandes. (F7) échappe Efface la ligne entière. CTRL + Fleche gauche / droite Navigue sur la ligne du prompt mot par mot. Powershell 2.0 alphorm.com™©
  • 19. ISE – Récapitulatif Commande Résultat CTRL+O Ouvre un script. CTRL+N Nouveau script. CTRL+S Sauvegarde le script. CTRL+T Nouvel onglet. CTRL+W Nouvel onglet réseau. F5 Exécution du code en cours. F8 Exécution d’une sélection du code. Powershell 2.0 alphorm.com™©
  • 20. Ce qu’on a couvert 1. Qu’est-ce PowerShell ? 2. Les différents versions existantes de PowerShell. 3. Prérequis pour nécessaire pour l’installation de PowerShell. 4. Présentation du prompt, et de l’environnement de Scripting intégré. 5. Navigation et raccourcis clavier. 6. Découverte des premières commandes de base. Powershell 2.0 alphorm.com™©
  • 21. Initiation à Windows PowerShell Apprentissage de PowerShell Introduction au langage Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 22. Plan • Vous connaissez déjà le PowerShell ! • Présentation de la structure et découverte premières commandes • Comment trouver de l’aide ? • Les variables Powershell 2.0 alphorm.com™©
  • 23. Le PowerShell vous connaissez déjà ! Les aliases Dir del Pusd Pwd Cls Powershell 2.0 alphorm.com™©
  • 24. Structure des commandes Verbe-nom Get-help Get-Command Set-wmiObject Move- Adcomputer Read-host Powershell 2.0 alphorm.com™©
  • 25. Comment trouver de l’aide ? • Get-help nom de la commande • Get-command • Get-member (gm) • Internet : PowerShell + commande (ou action a réaliser) Powershell 2.0 alphorm.com™©
  • 26. Les variables : Récapitulatif Nom Type Exemple String [string] Texte Bonjour Array [array]Tableau Bonjour, Bonsoir, salut Integer [int]Entier 1, 400, 1000, 14 Double [double]Doubl 14.456, 1.5, 78,4 etc… assignation $=contenue $=commande $=Opération Cmdlets Get-variable e Date [date]Une date 11/10/2013, etc… Hashtable @{} Jean;25 Michel;23 Hamid;30 Set-variable Clear-variable Remove-variable New-variable Powershell 2.0 alphorm.com™©
  • 27. Ce qu’on a couvert • Présentation de la structure et découverte des premières commandes • Comment trouver de l’aide. • Les variables. Powershell 2.0 alphorm.com™©
  • 28. Initiation à Windows PowerShell Apprentissage de PowerShell Opérateurs et expressions Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 29. Plan • Opérateurs arithmétiques • Opérateurs d’assignation • Opérateurs de comparaison • Opérateurs de traitement de texte • Opérateurs logiques Powershell 2.0 alphorm.com™©
  • 30. Opérateurs Arythmétiques Operateur Signification + Addition - Soustraction / Division * multiplication % Modulo Powershell 2.0 alphorm.com™©
  • 31. Opérateurs de d’assignation Operateur Signification = Assigniation. += Assignation an gardant la valeur precedente. -= Sous trait en reasignant le resultat. /= Divise en reasignant le resultat. %= Divise et assigne le modulo à la variable. Powershell 2.0 alphorm.com™©
  • 32. Opérateurs de comparaison Operateur Signification Variante sensible à la casse Variante insensible à la casse -eq Equal -ceq -ieq -ne Not equal -cne -ine -gt Greather then -cgt -igt -ge Greather or equal -cge -ige -lt Less then -clt -ilt -le Less or equal -cle -ile Powershell 2.0 alphorm.com™©
  • 33. Les opérateurs de traitement de text Operateur Significati on Variante sensible à la casse Variante insensible à la casse -like comme -clike -ilike -notlike Pas comme -cnotlike -inotlike -match Correspond -cmatch -imatch Operateur Signification -replace remplace -join concatène -split Sépare -notmatch Correspond pas -cnotmatch -inotmatch Operateur Signification -contains Contient -Notcontains Ne contient pas Powershell 2.0 alphorm.com™©
  • 34. Les opérateurs logiques Operateur Signification Variante Bits -and et -band -or ou -bor -not non -bnot -xor Ou exclusif -bxor Powershell 2.0 alphorm.com™©
  • 35. Ce qu’on a couvert • Opérateurs arithmétiques • Opérateurs d’assignation • Opérateurs de comparaison • Opérateurs de traitement de texte • Opérateurs logiques • Lien: http://www.cheatography.com/davechild/cheat-sheets/ regular-expressions/ Powershell 2.0 alphorm.com™©
  • 36. Initiation à Windows PowerShell Apprentissage de PowerShell Les providers Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 37. Plan • Que sont les providers ? • Pourquoi utiliser les providers ? • Démonstration Powershell 2.0 alphorm.com™©
  • 38. Les providers • Que sont les providers ? C’est un adaptateur PowerShell. Cela permet d’utiliser certaines parties du system de la même manière que l’utilisation du FileSystem sous dos par exemple. • Pourquoi utiliser les providers ? Cela permet de naviguer et d’effectuer des opérations de base dans un système (comme le registre Windows) de la même manière que dans un sytème de fichier. • Les commandes à utiliser dans les providers • Get-Item, Copy-Item, Remove-Item … Powershell 2.0 alphorm.com™©
  • 39. Les providers • Démonstration : Les providers disponibles Les commandes à utiliser au sein des providers Un exemple concret Powershell 2.0 alphorm.com™©
  • 40. Ce qu’on a couvert Pourquoi utiliser les providers Les providers disponibles Les Commandes • Get-Item, Clear-Item, Remove-Item Le chargement d’un module rajoute également un provider supplémentaire (Module Active Directory) Powershell 2.0 alphorm.com™©
  • 41. Initiation à Windows PowerShell Apprentissage de PowerShell La gestion du flux Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 42. Plan • Le pipe La rédaction de « one liners » à l’aide du « Pipe » • Les operateur de conditions • Les boucles • Les switchs • Démonstration Powershell 2.0 alphorm.com™©
  • 43. Le pipe « | » • A quoi ça sert ? • Export vers des fichiers externes • « Piper » des résultats vers d’autres commandes (Permet la rédaction de « one liners » ) • Démonstration Powershell 2.0 alphorm.com™©
  • 44. Les opérateurs de condition Les opérateurs de conditions Signification If Si Elseif sinon si else sinon • Démonstration Powershell 2.0 alphorm.com™©
  • 45. Les boucles Les boucles Signification While Tant que Do while Fait tantque Do until Fait jusqu’à Foreach Pour chaque • Démonstration For Pour Powershell 2.0 alphorm.com™©
  • 46. Les switchs • Dans quel cas utiliser un switch • La structure du switch • Démonstration Powershell 2.0 alphorm.com™©
  • 47. Ce qu’on a couvert • Le pipe La rédaction de « one liners » à l’aide du « Pipe » • Les operateur de conditions • Les boucles • Les switchs Powershell 2.0 alphorm.com™©
  • 48. Initiation à Windows PowerShell Apprentissage de PowerShell Import de données externes Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 49. Plan •Pourquoi importer des données ? • Import/export depuis différents supports: • Fichiers textes • Fichiers CSV • Fichiers XML •Export HTML Powershell 2.0 alphorm.com™©
  • 50. Pourquoi importer/exporter des données ? • Import: Pour faire un travail de moyen / grande échelle. Traiter des données fournies par d’autres services. Afin de garantir une base de travail stable. • Export: Exporter des rapports. Une nouvelle base de travail. Etc… Powershell 2.0 alphorm.com™©
  • 51. Fichiers textes: • Import Get-content • Export Out-file (, ) Possibilité de lire le fichier pendant que Out-file l’utilise) • Set-content • Attendre la fin de set-content pour pouvoir lire le fichier Add-content Powershell 2.0 alphorm.com™©
  • 52. Fichiers CSV: • Import Import-csv • Export Export-csv Dans le Shell • ConvertTo-CSV ConverTFrom-CSV Powershell 2.0 alphorm.com™©
  • 53. Fichiers XML: • Import Import-CLIXML (Objets exportés avec Export-CliXml) [xml]$ContenueXml = Get-content –path $FichierXml • Export Export-CliXML $variable.save(C:alpormationconfigurationDatas.xml) • Dans le Shell ConvertTo-XML Powershell 2.0 alphorm.com™©
  • 54. Export-html • Export ExportTo-HTML • Modifier le style (Css) Head Body Powershell 2.0 alphorm.com™©
  • 55. Ce qu’on a couvert • Import/export depuis différents supports: Fichiers textes. Fichiers CSV. Fichiers XML Fichiers HTML • A retenir : Caster : [XML]$MaVariable = Get-Content –path c:fichier.xml « Rapports » ConvertTo-Html Powershell 2.0 alphorm.com™©
  • 56. L’utilisation avancée de Windows PowerShell Le scripting Les fonctions et les filtres Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 57. Plan • Qu’est ce qu’une fonction ? • Qu’est ce qu’un filter ? • Les différences entre une fonction et un filter. • Quand utiliser une fonction, quand utiliser un filter ? Powershell 2.0 alphorm.com™©
  • 58. Les fonctions : La théorie • Utilité: S’exécute seulement une fois que tous les éléments du pipe sont chargés. Permet d’écrire et de nommer un bout de code qui peut être rappeler a tout moment. Permet d’effectuer une action qui va ou non, retourner une valeur / object Gain d’espace au sein du code. Organisation du code (Clarté du code). Gain de temps lors du codage (Réutilisabilité) . Powershell 2.0 alphorm.com™©
  • 59. Les Filters : La théorie • Utilité Commence à exécuté du code dés qu’elle reçoit du contenue S’utilise de la même manière qu’une fonction. A exactement les même avantages qu’une fonction. • Structure du code • Gain de place, gain de temps, réutilisation de code etc.. • Démonstration Powershell 2.0 alphorm.com™©
  • 60. Ce qu’on a couvert • Qu’est ce qu’une fonction ? • Qu’est ce qu’un filter ? • Les différences entre une fonction et un filter • Quand utiliser une fonction, quand utiliser un filter ? Powershell 2.0 alphorm.com™©
  • 61. L’utilisation avancée de Windows PowerShell Le scripting La gestion d’erreur Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 62. Introduction Powershell 2.0 alphorm.com™©
  • 63. Plan • ExecutionPolicy • Les différents types d’erreurs. • Le comportement de PowerShell face à une erreur. • Le détail d’une erreur. • Prévoir les erreurs, et agir en conséquence. Powershell 2.0 alphorm.com™©
  • 64. ExecutionPolicy Valeur Comportement lors de la rencontre d’une erreur Resitricted Impossible d’éxécuter des scripts. Possibilité d’utiliser le prompt uniquement (mode interactif). AllSigned Seulement les scripts qui sont signés peuvent être exécutés. Remote signed Les scripts téléchargés doivent être signés avant d’être exécutés. unrestricted Pas de restrictions. (demande de confirmation avant exécution d’un script). Bypass Aucune restriction, pas de demande de confirmation. Powershell 2.0 alphorm.com™©
  • 65. Les différent types d’erreurs • Les erreurs non-critiques (Non-Terminating). • Les erreurs critiques (Terminating). Powershell 2.0 alphorm.com™©
  • 66. Le comportement de PowerShell face à une erreur • La variable $errorractionpreference Valeur Comportement lors de la rencontre d’une erreur SilentlyContinue Le script continue son exécution sans affichage. Continue Le script continue son exécution, tout en affichant l’erreur. Stop Le script s’intérompt (Erreur critique). Inquire Demande comment ce comporter. Powershell 2.0 alphorm.com™©
  • 67. Le détail d’une erreur. • Le contenu de la variable $error . Powershell 2.0 alphorm.com™©
  • 68. Prévoir les erreurs, et agir en conséquence • $? • Trap {} • Try{}, Catch {}, Finally {} • Throw {} Powershell 2.0 alphorm.com™©
  • 69. Ce qu’on a couvert • Les erreurs critiques et non-crtitiques • Les differentes variables d’erreurs: $erroractionpreference $error $? • Ce que contient finalement une erreur c’est un object ! • Comment prévoir une erreur try, catch, finally Throw Powershell 2.0 alphorm.com™©
  • 70. L’utilisation avancée de Windows PowerShell Le scripting Les fonctions avancées Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 71. Plan • Qu’est ce qu’une fonction avancé? • Les « CmdletBinding » attributs • Les « Parameter » attributs • Documenter notre fonction Powershell 2.0 alphorm.com™©
  • 72. Les fonctions avancées: La théorie • Qu’est ce qu’une fonction avancé? Identique à une fonction « normal » sauf qu’elle permet plus de contrôle • Intégration de fonctionalités natives tel que le –Verbose ou encore le - debug • Control des paramètres - Permet la validation des paramètres - Création d’aide - Intégration d’aliases - Permettre le paramètre de provenir du « pipe » Powershell 2.0 alphorm.com™©
  • 73. Les « CmdletBinding » attributs • Utilité Doit ce mettre toujours avant la section Param() Permet l’activation des fonctionalités natives tel que le –verbose, -whatif, - debug, -confirm • Démonstration. Powershell 2.0 alphorm.com™©
  • 74. Les « Parameter » attributs • Utilité Permet de mettre de conditions de validation, et de control sur les différents paramètres de nos fonctions • Mandatory Force ou non qu’un valeur soit passé pour ce paramètre • Position Permet de définir une position fixe pour un certain paramètre • ValueFromPipeLine Permet de d’accepter ou non, qu’un paramètre provienne du pipe Powershell 2.0 alphorm.com™©
  • 75. Les « Parameter » attributs (suite) • ValueFromPipeLineByPropertyName Permet la de passer des paramètre via le pipe portant le même nom (exemple : « ComputerName ») • ValueFromRemainingArguments Permet d’utiliser ou non les arguments restant contenue dans le pipe • HelpMessage Permet de spécifier un message d’aide. • ValidateSet • ValidateScript Powershell 2.0 alphorm.com™©
  • 76. Documenter notre fonction • Les commentaires L’utilisation du signe « # » L’utilisation d’un champ de commentaire plus large : « # « code » # » Powershell 2.0 alphorm.com™©
  • 77. Le « comment-based help » • Comment créer une aide « professionnel » Il s’agit de mettre des tags à l’interieur d’un champ de commentaire # # .SYNOPSIS: Permet de spécifier en une phrase courte l’utilité du script ou de la fonction .DESCRIPTION: La description est généralement plus long. Elle permet d’écrire ce que le script fait en détail .PARAMETER NomDuParametre: Permet d’afficher des information concernant les paramètres de notre fonction (exemple : Computername) .EXAMPLE: Permet de spécifier un exemple précis concernant l’utilisation de la fonction / script. Powershell 2.0 alphorm.com™©
  • 78. Ce qu’on a couvert • Qu’est ce qu’une fonction avancé? • Les « CmdletBinding » attributs • Les « Parameter » attributs • Documenter notre fonction Les commentaires Le comment-based help Powershell 2.0 alphorm.com™©
  • 79. L’utilisation avancée de Windows PowerShell Le travail à grande échelle Les modules Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 80. Plan • Qu’est-ce un module PowerShell ? • Les différents types de modules existants. • Comment créer son propre module. • Les Modules manifest. • Comment créer son propre manifest. Powershell 2.0 alphorm.com™©
  • 81. Qu’est ce un module ? • Permet de regrouper un grand nombe de fonctions dans un même endroit. • Facilite la distribution. • Facilite l’accès à des nouvelles fonctionalités qui ne sont pas toujours nécessaires. • Facilite le partage. • Permet la standardisation de fonctions de base. Powershell 2.0 alphorm.com™©
  • 82. Les différents types de modules existants • Binary modules Code écrit en C# Extension .DLL • Script modules Basés sur des fichiers textes contenants des fonctions Extension .PSM1 Powershell 2.0 alphorm.com™©
  • 83. Les commandes de base • Get-module • Import-module • Remove-module • Démonstration Powershell 2.0 alphorm.com™©
  • 84. Comment créer un script module • Fichier text • Fonctions • Extension .psm1 • Démonstration Powershell 2.0 alphorm.com™©
  • 85. Les modules manifest • Qu’est un module manifest ? A été créer pour pouvoir créer de modules de manière pouvoir les distribuer a grande échelle Contiendras les informations tel que : L’auteur, le copyright, Nom de l’entreprise, version de PowerShell a utiliser etc… C’est un fichier avec l’extension .psd1 • Démonstration Powershell 2.0 alphorm.com™©
  • 86. Ce qu’on a couvert • Qu’est-ce un module PowerShell ? • Les différents types de modules existants • Les Modules manifest Powershell 2.0 alphorm.com™©
  • 87. L’utilisation avancée de Windows PowerShell Le travail à grande échelle L’exécution à distance Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 88. Plan: L’exécution à distance • Les prérequis • Les commandes offrant nativement des fonctionnalités d’exécution a distance. • Les connexions Non-Persistantes • Les connexions Persistantes Interactives • Les connexions Persistantes Non-interactives Powershell 2.0 alphorm.com™©
  • 89. Les prérequis Windos remote management (WINRM) Désactivée par défaut. • Web Services for management (WS-MAN) • HTTP, HTTPS (WINRM 2.0 5985) Par défaut, il est possible pour toute machine eéquipée de PowerShell 2.0 d’initier des connections distances. Certaines conditions doivent être respectées pour pouvoir accepter ses connections. Powershell 2.0 alphorm.com™©
  • 90. Les prérequis –Mise en place • Une machine en workgroup Enable-PsRemoting • Active le service WinRM, Intègre Set-WSMANQuickConfig • Déploiement en grande échelle(GPO) Computer Configuration-Policies-Administrative templates-Windows Components Configuration Policies WindowsSettings SecuritySettings SystemServices Windows Windows remote management = Automatic • TOUJOURS ouvrir en tant que “Administrator” Powershell 2.0 alphorm.com™©
  • 91. Les commandes et le remoting • Beaucoup de commandes permettent déjà de faire de l’execution a distance via “-computername” • Démonstration Powershell 2.0 alphorm.com™©
  • 92. Cmdlet avec -computerName • Get-WinEvent • Get-Counter • Get-EventLog • Clear-EventLog • Remove- EventLog • Get-WmiObject • Get-Process • Get-Service • Add-Computer • Remove-Computer • Rename-Computer • Reset- ComputerMachineP • Write-EventLog • Limit-EventLog • Show-EventLog • New-EventLog • Remove-EventLog • Get-WmiObject • Set-Service • Get-HotFix • Restart- Computer • Stop-Computer • Add-Computer assword Powershell 2.0 alphorm.com™©
  • 93. Les connections Non-Persistantes Non-interactives Invoke-command L’exécution d’une seule commande voir d’un script à distance. Fonctionne en 3 étapes: • Établissement de le connexion • Envois de la commande / script • Fermeture de la connexion Démonstration Powershell 2.0 alphorm.com™©
  • 94. Les connections Non-Persistantes Non-interactives • Les inconvénients de invoke-command Est peut être simple d’utilisation mais la création de connexion, vérification de version etc est lourd pour l’os. Ne permet pas de travailler de manière interactive Impossibilité de garder des variables / fonctions chargées en mémoire • Avantages Permet de deployer un script /commandes sur plusieurs machines distantes Powershell 2.0 alphorm.com™©
  • 95. Connection Persistante interactive • Possibilité de créer une session, executer des commandes, scripts, de quitter la session, puis de reprendre la session la ou elle s’était arrêter. • Enter-PsSession • Démonstration Powershell 2.0 alphorm.com™©
  • 96. Connexion Persistante Non-interactive • Ouvrir et fermer la connexion après chaque exécution de commande / script est lourd. • Permet de créer une connexion persistante • Elle est non-interactive (ne permet pas de travailler sur le retour des commandes) • New-PsSession • Démonstration Powershell 2.0 alphorm.com™©
  • 97. TroubleShooting • Service WINRM toujours sur automatic Par défaut pour OS serveurs. Pas pour OS clients. Powershell 2.0 alphorm.com™©
  • 98. Ce qu’on a couvert • Les prérequis • Les commandes offrant nativement des fonctionnalités d’exécution a distance. • Les connexions Non-Persistantes • Les connexions Persistantes Non-interactives • Les connexions Persistantes Interactives Powershell 2.0 alphorm.com™©
  • 99. L’utilisation avancée de Windows PowerShell Le travail à grande échelle L’exécution en tâche de fond : Les jobs Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 100. Plan • Introduction •Un « job », c’est quoi ? • Les commandes Commandes natives Cmdlets PowerShell Powershell 2.0 alphorm.com™©
  • 101. Introduction : Dir C: -recurse Powershell 2.0 alphorm.com™©
  • 102. Un job, c’est quoi ? • Cela va nous permettre de faire d’éxecuter des commandes en arrière plan, et nous libérer le prompt immédiatement. • Très utile lorsqu’on utilise des commandes / scripts qui ont besoin de beaucoup de temps pour finir . Powershell 2.0 alphorm.com™©
  • 103. Les commandes • 3 façons de créer un ‘job’ Avec –AsJob • Get-WmiObject –Asjob (Execute toujours la commande l’un apres l’autre) • Invoke-command –AsJob • Cmdlet job Start-job –ScriptBlock{…} Powershell 2.0 alphorm.com™©
  • 104. Utilisation: • Récupération des résultats: • Get-job Retourne le statut actual des jobs. • Receive-job Récupère le résultat du job. L’option –keep Permet de garder le retour de la console (Par défaut le retour est supprimé). Powershell 2.0 alphorm.com™©
  • 105. Utilisation: • Actions sur un job : Get-job Remove-job • Supprime un job. Wait-job • Attends que le job ce termine. Receive-job • Récupère le résultat. Démonstration Powershell 2.0 alphorm.com™©
  • 106. Les jobs enfants • Get-job –id JobId ¦ select-object –expand childjobs • Démonstration Powershell 2.0 alphorm.com™©
  • 107. Gérer les jobs • Il est possible de gerer les jobs en identifiant les jobs parmi une de identification suivantes : N° ID Nom du job Piper directement le job vers une des commande de gestion • Commandes disponibles Remove-job Stop-Job Wait-job Powershell 2.0 alphorm.com™©
  • 108. Ce qu’on a couvert • Synchrone / Asynchrone Différences • Les jobs fonctionnent en 3 étapes Lancement du job Start-job • Récupérer les résultats / les états des jobs • Receive-job Gérer les jobs • Get-job, wait-job, remove-job, Stop-Job Powershell 2.0 alphorm.com™©
  • 109. La maîtrise de Windows PowerShell Créer ses propres cmdlets Le WMI Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 110. Plan • Qu’est ce que le WMI ? • A quoi ça vous servir ? • Quels sont les prérequis ? • Quelques outils indispensables pour gérer le WMI • L’architecture WMI en quelques mots • PowerShell et le WMI Powershell 2.0 alphorm.com™©
  • 111. Qu’est ce que le WMI ? • Windows Management Interface Est l’implémentation Microsoft du modèle de données CIM (Common information Model) C’est une modèle de données qui a été créer dans le but de pouvoir manager de manière universelle des systèmes divers (PC, Servers, switch, applications system d’exploitations etc..) • WMI (CIM) permet d’interagir avec n’importe quel système de manière standardisé. Existe depuis l’implémentation depuis Windows 2000 sp2 Est devenue très facilement accessible avec l’arrivé de PowerShell Powershell 2.0 alphorm.com™©
  • 112. A quoi ça vous servir ? • Avoir un control sur les éléments du systèmes offert par des ‘providers’ tel qu’une application, la base de registre, ou encore le système d’exploitation. • Avoir accès a des informations / méthodes supplémentaires de l’OS. • Exemple : Access informations du BIOS Possibilité créer de partages Powershell 2.0 alphorm.com™©
  • 113. Quels sont Les prérequis ? • Aucun ! Si ce n’est qu’il faut avoir les bons outils pour pouvoir explorer WMI Powershell 2.0 alphorm.com™©
  • 114. Les outils pour explorer le WMI • Ils ont tous des noms surprenant ! WMI explorer • http://www.ks-soft.net/hostmon.eng/downpage.htm WMI explorer • Sapien WMI explorer… ( fait par The powerShell Guy (script powerShell)) • http://jdhitsolutions.com/blog/2013/03/wmi-explorer-from-the-powershell- guy/ Ou encore… WMI explorer • SolarWinds http://www.solarwinds.com/products/freetools/wmi_monitor/ Powershell 2.0 alphorm.com™©
  • 116. L’architecture WMI en quelques mots • Les ‘providers’ offrent des ‘classes’ dans les quels ce trouvent des ‘instances’. Chaque instance a des propriétés (Nom, Description) • Et peut avoir des ‘méthodes’ tel que Stop, start delete etc.. • Démonstration de WMI explorer et de l’architecture WMI Powershell 2.0 alphorm.com™©
  • 117. PowerShell et le WMI • Les commandes PowerShell disponibles permettant de gérer le WMI Get-WMIObject • Retourne des objects de WMI Set-WmiInstance • Permet de mettre des valeurs a des propriétées WMI Invoke-WMIMethod • Permet d’appeler une méthode (WMI) Remove-WmiObject • Permet de supprimer une instance créer de la base WMI Démonstration Powershell 2.0 alphorm.com™©
  • 118. Ce qu’on a couvert • Qu’est ce que le WMI ? • A quoi ça vous servir ? • Quels sont Les prérequis ? • Quelques outils indispensables pour gérer le WMI • L’architecture WMI en quelques mots • PowerShell et le WMI Les commandes WMI • .put() Powershell 2.0 alphorm.com™©
  • 119. La maîtrise de Windows PowerShell Créer ses propres cmdlets L’automatisation d’applications : Les objets COM Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 120. Plan • Qu’est ce qu’un objet COM ? • A quoi ça vous servir ? • PowerShell et les objets COM Powershell 2.0 alphorm.com™©
  • 121. Qu’est ce qu’un objet COM ? • Un objet COM est une interface offerte par les fabriquant de logiciels afin d’offrir une possibilité d’automatisation sur leurs produits Powershell 2.0 alphorm.com™©
  • 122. A quoi ça vous servir ? • Les objets COM va permettre d’automatiser des actions au sein de programmes connues tel que Word, Internet explorer ou bien encore de l’explorateur de fichier. Powershell 2.0 alphorm.com™©
  • 123. PowerShell et les objets COM • Comment identifier les objets COM existants ? Registre WMI • Comment utiliser un objet COM ? $Variable = New-Object –ComObject NomComObjet $Variable | Get-Member • Démonstration Powershell 2.0 alphorm.com™©
  • 124. Ce qu’on a couvert • Qu’est ce qu’un objet COM ? • A quoi ça vous servir ? • PowerShell et les objets COM Powershell 2.0 alphorm.com™©
  • 125. La maîtrise de Windows PowerShell Créer ses propres cmdlets L’exploitation du DotNet Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 126. Plan • Introduction • Pourquoi utiliser le .NET • Le vocabulaire • Comment instancier des objets • Notre premier fonction basée sur DotNet Powershell 2.0 alphorm.com™©
  • 127. Introduction •Module difficile • Il y a beaucoup de vocabulaire liée au développement. Ceci dépasse un peu les compétences de base d’un simple « scripteur » Powershell 2.0 alphorm.com™©
  • 128. Pourquoi utiliser le .NET ? • PowerShell offre beaucoup de cmdlets (236 en PowerShell 2.0) • On peut augmenter ce nombre grâce au différents modules disponibles (Active Directory, Module Exchange etc..) • Des fois, ce n’est pas suffisant • PowerShell est basé sur du .NET, donc tout ce qui est faisable en .NET, on peut le faire en PowerShell. Powershell 2.0 alphorm.com™©
  • 129. Le vocabulaire Classe L’espace de noms NameSpace Struct Interfaces Class Methode Method Propiétes Properties Class Methode Method Propriétes Properties Class Methode Method Propiétes Properties Powershell 2.0 alphorm.com™©
  • 130. Le vocabulaire L’espace de noms NameSpace Classe Contient des classes L’équivalent a une sorte de modèle qui contiens ‘des membres’(Méthodes propriétés) Class Méthode Method Propriétés Properties Une méthode retourne une valeur, ou le résultat d’une opération C’est comme une variable : cela contient une valeur Powershell 2.0 alphorm.com™©
  • 131. Les classes statiques • Les classes statiques n’ont pas besoin d’être ‘instanciées’. (Et ne peuvent pas l’être). •Méthodes retournant simplement un résultat. • C’est la façon ‘facile’ d’utilser le .NET au sein de PowerShell • Démonstration Powershell 2.0 alphorm.com™©
  • 132. Comment s’en servir ? L’espace de noms NameSpace Classe Instanciation Methode Class Methode Method Propiétes Properties Method Propiétes Properties Powershell 2.0 alphorm.com™©
  • 133. La jungle des classes • Comment trouve-t-on les classes / Méthodes / propriétés .NET Notre moteur de recherché favoris + msdn (ou .NET) Demonstration Powershell 2.0 alphorm.com™©
  • 134. Les assemblies • Une assembly c’est un fichier.DLL qui va contenir des classes, qui vont pouvoir êre chargés dans .NET. Ceci dans un but de gain d’éspace disque, et de réutilisabilité du code. • PowerShell charge beaucoup de composants du framework .NET par défaut, mais certains éléments le sont pas. Il est cépendant possible de les chargés afin d’avoir accès à leur Classes, méthodes et propriétés via powershell. Powershell 2.0 alphorm.com™©
  • 135. Ce qu’on a couvert • Introduction • Pourquoi utiliser le .NET • Le vocabulaire Le framework Les espaces de nom Les classes (static et non static) • Méthodes propriétés • Comment instancier des objets • Notre premier fonction basée sur DotNet Powershell 2.0 alphorm.com™©
  • 136. Conclusion Stéphane van Gulick Consultant systèmes et automatisation Certifications : MCT, MCITP, MCSA Contact : svangulick@alphorm.com Twitter : @Stephanevg Site : http://www.alphorm.com Blog : http://www.ConfigMgrdistrict.com Blog : http://www.Powershelldistrict.com Forum : http://www.alphorm.com/forum Powershell 2.0 alphorm.com™©
  • 137. Conclusion • Regard en arrière Initiation, approfondissement, specialisation • Prochaine étapes PowerShell 3.0 PowerShell lié aux composants MS (Active directory, Exchange, System Center) Scripter le plus possible Powershell 2.0 alphorm.com™©
  • 138. Merci ! Powershell 2.0 alphorm.com™©

Notas del editor

  1. Console Prompt : Options Command historyBuffer size(F7,fleche haut et du bas).
  2. $variable = « Bonjour »$variable.gettype()$variable –is string$variable –isnotinteger$variable = 11/08/2013 $variable -as [datetime][datetime]$variableConcatener deux stringsInt  cast to string. Add 10 show concatenation.$Date = Get-date$date | gm$date2 = $date.adddays(2)Hash table:$Hash = @{ « Hamid »; « 30 »}$hast.add(« Jean »,  45)
  3. Parler des conditions avec « -and » « -or »
  4. Le trap est à éviter car ilempeched’avoirune structure du flux cohérente. Un grand script perderasrapidement de çalogique, et sera difficile a débeuger.Le try catch finally estl’option à préferer. C’estmieux de cibler les surunecommande precise, plustotquesur tout un script en entier car on peut y ajouter des messages personalisés, voir un code en consequence.Throw estsurtout utilize pour les parametres.
  5. Le trap est à éviter car ilempeched’avoirune structure du flux cohérente. Un grand script perderasrapidement de çalogique, et sera difficile a débeuger.Le try catch finally estl’option à préferer. C’estmieux de cibler les surunecommande precise, plustotquesur tout un script en entier car on peut y ajouter des messages personalisés, voir un code en consequence.Throw estsurtout utilize pour les parametres.
  6. Parler des limitations:Estpeutêtre simple d’utilisationmais la creation de connection, verification de version etc et lourd pour l’os.Ne permet pas de travailler de manière interactiveImpossibilité de garder des variables / fonctions chargés en mémoire
  7. Les methods et les propriétessont les membresqu’offrent la classe.Vousvousêtes le conaissez déjà : Get-member ;)Une method contienttoujours un couple de parentheses () à la fin, alorsqu’unepropriétén’en as jamais.
  8. [appdomain]::CurrentDomain.GetAssemblies()| %{$_.fullname.split(",")[0]}