vendredi 28 décembre 2012

WinPE 3.0 avec l'outil ImageX inclus


Salut à tous,


Je sais j'ai un peu mis de côté Powershell pour le moment car au travail on est parti sur un sujet tout autre, d'ou un petit tutoriel sur la création d'un WinPE.
Pour ceux qui ne savent pas ce qu'est WinPE, il s'agit de Windows Preinstallation Environment. Il s'agit d'un système d'exploitation allégé permettant d'effectuer des opérations sur une machine ne possédant pas encore de système d'exploitation installé.


Pour ce petit tutoriel, voici le matériel dont on a besoin (en plus de vous et votre ordinateur ;) ) :

- 1 clé USB (2Go min)
- le pack WAIK (disponible sur le site de Microsoft). Attention prévoir du temps pour le téléchargement de ce pack qui pèse environ 1,7Go.




Procédure

- copype.cmd amd64 c:\WinPE_x64
// Lance le script copype.cmd qui permet de créer une architecture de dossier et d'y copier les fichiers nécessaires à notre architecture. Après copype.cmd, on trouve 2 paramètres : l'architecture et l'emplacement du dossier ou l'on veut créer le WinPE et toute son arborescence.



- copy c:\WinpE_x64\winpe.wim c:\WinPE_x64\ISO\sources\boot.wim
// On copie l'image winpe.wim dans le dossier ISO\sources et on le renomme en boot.wim



- Dism /Mount-Wim /WimFile:C:\WinPE_x64\ISO\sources\boot.wim /index:1 /MountDir:C:\WinPE_x64\mount
// On monte l'image dans le répertoire mount afin d'y apporter des modification



- Dism /image:C:\WinPE_x64\mount /Set-InputLocale:fr-FR
// Paramétrage du clavier



- Dism /image:C:\WinPE_x64\mount /Set-UserLocale:fr-FR
// Paramétrage du clavier



- copy "C:\Program Files\Windows AIK\Tools\amd64\imagex.exe" c:\WinPE_x64\mount\Windows\System32\
// Incorporation dans notre image de l'outil ImageX.exe



- Dism /unmount-Wim /MountDir:C:\WinPE_x64\mount /Commit
// Sauvegarde des modifications apportées à notre image



-oscdimg -n -h -bc:\WinPE_x64\etfsboot.com c:\WinPE_x64\iso c:\WinPE_x64\WinPE_x64.iso
// Génération d'un fichier ISO



Une fois l'ISO généré, vous pouvez graver un média en vous basant sur cette ISO.

Sinon vous avez également la possibilité de créer une clé USB bootable avec les fichiers du WinPE dessus.
Pour créer une clé USB bootable, on va se servir de l'outil DISKPART (disponible nativement sous Windows Seven et Windows Server 2008 & 2008R2).



Procédure :

- list disk
// Permet d'afficher une liste des disques actuellement connecté à la machine



- select disk 0
// On sélectionne le disk correspondant à notre clé USB (le '0' est un exemple - voir le résultat du 'list disk' en ce qui concerne votre cas)



- clean
// On fait un nettoyage rapide de la clé



- create partition primary
// On créer une partition primaire sur notre clé



- format fs=ntfs quick
// On formate cette partition en NTFS afin de pouvoir y mettre des fichiers supérieurs à 4Go



- assign
// On attribue une lettre à notre clé USB de façon à ce qu'elle apparaisse au niveau du Poste de travail



- active
// On rend notre clé USB bootable



- exit
// On quitte l'outil diskpart



Il ne nous reste plus qu'à copier les fichiers WinPE sur la clé USB

- xcopy C:\WinPE_x64\iso\*.* /e G:\



Vous pouvez alors redémarrer votre machine et booter sur la clé USB (attention à l'ordre d'amorçage au niveau du BIOS). Vous avez un WinPE opérationnel et inclus l'outil Imagex pour créer des fichiers wim (capture une image) ou la restaurer.


Virtual87
En informatique, on en apprend tous les jours

mardi 6 novembre 2012

Lien Powershell - MS DOS


Bonjour à tous,

Aujourd’hui, billet n°4 sur Powershell.
Nous allons voir le lien entre Powershell et la bonne vieille invite de commande DOS.

Petit historique de DOS :
Après avoir conclu son « deal » historique avec IBM, Bill Gates s'est mis à la recherche d'un système d'exploitation qu'il pourrait effectivement fournir à IBM pour le lancement de l'IBM PC. Selon Gordon Letwin lui-même, l'objectif de Microsoft était que MS-DOS soit aussi compatible avec CP/M que possible. Gates rachète alors QDOS (Quick and Dirty OS) à la petite société SCP (Seattle Computer Products). QDOS est en fait un clone à bas prix de CP/M écrit par Tim Paterson. Bill Gates demande alors à Tim Paterson d'adapter QDOS à l'IBM PC et de le renommer MS-DOS.
MS-DOS est longtemps resté la base des systèmes d'exploitation grand public de Microsoft, bien que l'installation de Windows en modifie in-situ des portions de plus en plus grandes. En 1995, date d'apparition de Windows 95 il devint invisible pour les utilisateurs car l'interface graphique était directement exécutée au démarrage. MS-DOS est resté une sous-couche des versions grand-public de Windows (comme Windows 98 et Me) jusqu'à l'avènement de Windows XP qui marque son abandon réel par Microsoft au profit du système NT. Le DOS en était alors à sa version 8.
Les versions récentes de Windows possèdent toujours un « interpréteur de commandes » (command prompt), dont les commandes sont héritées de celles de MS-DOS, malgré quelques modifications, et qui permet d'exécuter des programmes Windows en mode texte (qui ne sont en aucun cas des programmes DOS, ils sont complètement différents), ainsi que des programmes MS-DOS grâce à un émulateur intégré, émulant MS-DOS 8. Cependant, cet interpréteur (cmd.exe) n'est pas celui de MS-DOS à proprement parler (command.com), et certains anciens programmes DOS ne peuvent s'exécuter dans ce mode.
Cet émulateur émule aussi les fichiers de configuration CONFIG.SYS et AUTOEXEC.BAT de MS-DOS sous le nom de: \system32\CONFIG.NT et \system32\AUTOEXEC.NT.
(source Wikipedia)

A savoir :
  • Ce n’est pas parce que vous êtes dans une fenêtre Powershell, que vous ne pouvez pas taper de commande DOS.


  • Si vous êtes dans une fenêtre Powershell et que vous avez absolument besoin d’ouvrir une fenêtre DOS, pas de panique. Ne vous embêtez pas à retourner dans ‘Démarrer’ à’Exécuter’ à …. Dans votre fenêtre Powershell, tapez simplement cmd et vous passerez en ancienne console DOS (attention la couleur bleu de Powershell sera toujours présente). Pour quitter le mode DOS et repasser en Powershell, vous n’avez simplement qu’à taper ‘exit » et valider.


  • Certaines commandes vont demander des droits administrateurs pour pouvoir être exécuté. Pour cela vous devrez lancer la console Powershell en faisant un clic droit dessus à ‘Exécuter en tant qu’administrateur’.

Message d’erreur sur les privilèges insuffisants

Ouverture du programme avec les droits ‘Administrateur’

  • Liste des commandes externes sous DOS :

  • Les cmdlets en Powershell

Pour rappel, les cmdlets sont le nouveau nom des commandes qui sont lancés dans une fenêtre Powershell. Elles sont composés d’un verbe et d’un nom (le tout séparé par un tiret).
Pour information, il existe ???(nombre de cmdlets) cmdlets.
Une des cmdlets à connaitre absolument, c’est celle vous affichant l’aide ‘help’. Vous pouvez taper un verbe /help pour connaître les différentes options qui peuvent se trouver derrière votre verbe, ….

Je vous renvoie vers le billet traitant sur les verbes en Powershell pour plus de détails.

Bonne méditation sur Powershell et à très bientôt pour la suite

Virtual87

lundi 29 octobre 2012

L'interaction avec Powershell


Salut à tous,

On va essayer d’enchainer sur un troisième billet Powershell. Le sujet de celui-ci est l’interaction avec Powershell.

Comme vous devez vous en douter maintenant, Powershell est un outil puissant et celui qui comprend son principe et touche un peu dans la programmation, peu devenir un maître des scripts.

Voyons tout de suite une des utilisations que l’on peut faire de Powershell et je suis sûr que celle-ci va vous surprendre. Il s’agit d’utiliser Powershell comme une calculatrice.

La calculatrice
Je sais tout de suite ce que vous allez me dire, à quoi cela sert de se servir de Powershell en tant que calculatrice alors que Windows en a incorporé une par défaut. La réponse est simple : Powershell permet de faire des opérations arithmétiques standard (+, -, /, X) mais il permet également de faire des opérations par rapport aux unités informatiques (KB (Kilo-bits), MB (Mega-bits), GB (Giga-bits).

Ouvrez une console et taper : ‘4.7GB / 700MB’ (noter que pour l’écriture de nombre non entier, on utilise le ‘point’). Vous obtiendrez comme résultat :

Autre fonction étonnante de Powershell en tant que calculatrice, il permet de faire des conversions Héxadécimal – Décimal. Il suffira simplement de respecter la règle suivante => votre nombre héxadécimal devra être précédé du préfixe ‘0X’.

Exemple :

Alors vous en pensez quoi de notre Powershell ???


Résumé des opérations possibles avec Powershell en tant que calculatrice :
Opérateur
Description
Opération
Résultat
+
Additionner 2 valeurs
5 + 10.5
15.5
2gb + 120mb
2273312768
0X100 + 5
261
« Je suis  » + « là »
Je suis là
-           
Soustraire 2 valeurs
10.5 - 5
5.5
12gb – 4.5gb
8053063680
200 - 0XAB
29
*
Multiplier 2 valeurs
5 * 4.5
22.5
4mb * 3
12582912
12 * 0xC0
2304
« x » * 5
xxxxx
/
Diviser 2 valeurs
5 / 4.5
1.111111111111
1mb / 30kb
34.13333333333
0xFFAB / 0xC
5454.25
%
Obtenir le reste de la division
5%4.5
0.5

Amusez-vous bien dans vos calculs et conversions.

Virtual87

jeudi 18 octobre 2012

Powershell - Les verbes


Salut à tous,

Aujourd’hui, deuxième billet sur Powershell.
Je ne sais pas ce que vous avez pensé du premier billet mais si vous vous souvenez bien j’avais laissé une partie en suspens : l’explication sur la structure des cmdlets et sur les verbes en Powershell.
Plutôt que de vous sortir un charabia incompréhensible, je préfère vous mettre en ligne un article parut sur le site msdn.microsoft.com qui ont réussi à expliquer l’utilisation des règles de nommage des verbes, donner une liste des différents verbes avec les actions qui correspondent, …
Je m’excuse par avance, le document en question est en anglais. Si cela pose problème à certains, je ferai une traduction.

Vous trouverez l’article ci-dessous et le lien juste ici :

Windows PowerShell uses a verb-noun pair for the names of cmdlets and for their derived Microsoft .NET Framework classes. For example, the Get-Command cmdlet provided by Windows PowerShell is used to retrieve all the commands that are registered in Windows PowerShell. The verb part of the name identifies the action that the cmdlet performs. The noun part of the name identifies the entity on which the action is performed.
Note:
Windows PowerShell uses the term verb to describe a word that implies an action even if that word is not a standard verb in the English language. For example, the term New is a valid Windows PowerShell verb name because it implies an action even though it is not a verb in the English language.

Verb Naming Rules

The following list provides guidelines to consider when you choose the verb for a cmdlet name:
  • When you specify the verb, we recommend that you use one of the predefined verb names provided by Windows PowerShell (aliases for these predefined verbs are included in the following tables). When you use a predefined verb, you ensure consistency between the cmdlets that you create, the cmdlets that are provided by Windows PowerShell, and the cmdlets that are designed by others.
  • Use the predefined verbs to describe the general scope of the action, and use parameters to further refine the action of the cmdlet. 
  • To enforce consistency across cmdlets, do not use a synonym of an approved verb.
  • Use only the form of each verb that is listed in this topic. For example, use "Get", but do not use "Getting" or "Gets".
  • Use Pascal casing for verbs. In Pascal casing the initial letter of each word is capitalized, such as “ForEach”. 
  • Do not use the following reserved verbs or aliases. These verbs are used by the Windows PowerShell language, or by special case cmdlets provided by Windows PowerShell. 
    • ForEach (foreach)
    • Format (f)
    • Group (gp)
    • Sort (sr)
    • Tee (te)
    • Where (wh)

Similar Verbs for Different Actions

The following similar verbs represent different actions.
New vs. Set
The New verb is used to create a new resource. The Set verb is used to modify an existing resource, optionally creating the resource if it does not exist, such as the Set-Variable cmdlet.

Find vs. Search
The Find verb is used to look for an object. The Search verb is used to create a reference to a resource in a container.

Get vs. Read
The Get verb is used to retrieve a resource, such as a file. The Read verb is used to get information from a source, such as a file.

Invoke vs. Start
The Invoke verb is used to perform an operation that is generally a synchronous operation, such as running a command. The Starverb is used to begin an operation that is generally an asynchronous operation, such as starting a process.

Ping vs. Test
Use the Test verb.


Common Verbs

Windows PowerShell uses the VerbsCommon enumeration class to define generic actions that can apply to almost any cmdlet. The following table lists most of the defined verbs.

 

Verb (alias)
Action
Comments
Add (a)
Adds a resource to a container, or attaches an item to another item. For example, the Add-Content cmdlet adds content to a file. This verb is paired with Remove.
For this action, do not use verbs such as Append, Attach, Concatenate, or Insert.
Clear(cl)
Removes all the resources from a container but does not delete the container. For example, the Clear-Content cmdlet removes the contents of a file but does not delete the file.
For this action, do not use verbs such as Flush, Erase, Release, Unmark, Unset, or Nullify.
Close(cs)
Changes the state of a resource to make it inaccessible, unavailable, or unusable. This verb is paired with Open.
Copy(cp)
Copies a resource to another name or to another container. For example, theCopy-Item cmdlet that is used to access stored data copies an item from one location in the data store to another location.
For this action, do not use verbs such as Duplicate, Clone, Replicate, or Sync.
Enter(et)
Specifies an action that allows the user to move into a resource. For example, theEnter-PSSession cmdlet places the user in an interactive session. This verb is paired with Exit.
For this action, do not use verbs such as Push or Into.
Exit (ex)
Sets the current environment or context to the most recently used context. For example, the Exit-PSSession cmdlet places the user in the session that was used to start the interactive session. This verb is paired with Enter.
For this action, do not use verbs such as Pop or Out.
Find(fd)
Looks for an object in a container that is unknown, implied, optional, or specified.
Format(f)
Arranges objects in a specified form or layout.
Get (g)
Specifies an action that retrieves a resource. This verb is paired with Set.
For this action, do not use verbs such as Read, Open, Cat, Type, Dir, Obtain, Dump, Acquire, Examine, Find, or Search for this action.
Hide (h)
Makes a resource undetectable. For example, a cmdlet whose name includes the Hide verb might conceal a service from a user. This verb is paired with Show.
For this action, do not use a verb such as Block.
Join (j)
Combines resources into one resource. For example, the Join-Path cmdlet combines a path with one of its child paths to create a single path. This verb is paired with Split.
For this action, do not use verbs such as Combine, Unite, Connect, or Associate.
Lock(lk)
Secures a resource. This verb is paired with Unlock.
For this action, do not use verbs such as Restrict or Secure.
Move(m)
Moves a resource from one location to another. For example, the Move-Itemcmdlet moves an item from one location in the data store to another location.
For this action, do not use verbs such as Transfer, Name, or Migrate.
New (n)
Creates a resource. (The Set verb can also be used when creating a resource that includes data, such as the Set-Variable cmdlet.)
For this action, do not use verbs such as Create, Generate, Build, Make, or Allocate.
Open(op)
Changes the state of a resource to make it accessible, available, or usable. This verb is paired with Close.
Pop(pop)
Removes an item from the top of a stack. For example, the Pop-Location cmdlet changes the current location to the location that was most recently pushed onto the stack.
Push(pu)
Adds an item to the top of a stack. For example, the Push-Location cmdlet pushes the current location onto the stack.
Redo(re)
Resets a resource to the state that was undone.
Remove(r)
Deletes a resource from a container. For example, the Remove-Variable cmdlet deletes a variable and its value. This verb is paired with Add.
For this action, do not use verbs such as Clear, Cut, Dispose, Discard, or Erase.
Rename(rn)
Changes the name of a resource. For example, the Rename-Item cmdlet, which is used to access stored data, changes the name of an item in the data store.
For this action, do not use a verb such as Change.
Reset(rs)
Sets a resource back to its original state.
Search(sr)
Creates a reference to a resource in a container.
For this action, do not use verbs such as Find or Locate.
Select(sc)
Locates a resource in a container. For example, the Select-String cmdlet finds text in strings and files.
For this action, do not use verbs such as Find or Locate.
Set (s)
Replaces data on an existing resource or creates a resource that contains some data. For example, the Set-Dateackup cmdlet changes the system time on the local computer. (The New verb can also be used to create a resource.) This verb is paired with Get.
For this action, do not use verbs such as Write, Reset, Assign, or Configure.
Show(sh)
Makes a resource visible to the user. This verb is paired with Hide.
For this action, do not use verbs such as Display or Produce.
Skip(sk)
Bypasses one or more resources or points in a sequence.
For this action, do not use a verb such as Bypass or Jump.
Split (sl)
Separates parts of a resource. For example, the Split-Path cmdlet returns different parts of a path. This verb is paired with Join.
For this action, do not use a verb such Separate.
Step (st)
Moves to the next point or resource in a sequence.
Switch(sw)
Specifies an action that alternates between two resources, such as to change between two locations, responsibilities, or states.
Undo(un)
Sets a resource to its previous state.
Unlock(uk)
Releases a resource that was locked. This verb is paired with Lock.
For this action, do not use verbs such as Release, Unrestrict, or Unsecure.
Watch(wc)
Continually inspects or monitors a resource for changes.

Communications Verbs

Windows PowerShell uses the VerbsCommunications class to define actions that apply to communications. The following table lists most of the defined verbs.

 

Verb (alias)
Action
Comments
Connect(cc)
Creates a link between a source and a destination. This verb is paired with Disconnect.
For this action, do not use verbs such as Join or Telnet.
Breaks the link between a source and a destination. This verb is paired with Connect.
For this action, do not use verbs such as Break or Logoff.
Read (rd)
Acquires information from a source. This verb is paired with Write.
For this action, do not use verbs such as Acquire, Prompt, or Get.
Receive (rc)
Accepts information sent from a source. This verb is paired withSend.
For this action, do not use verbs such as Read, Accept, or Peek.
Send (sd)
Delivers information to a destination. This verb is paired withReceive.
For this action, do not use verbs such as Put, Broadcast, Mail, or Fax.
Write (wr)
Adds information to a target. This verb is paired with Read.
For this action, do not use verbs such as Put or Print.


Data Verbs

Windows PowerShell uses the VerbsData class to define actions that apply to data handling. The following table lists most of the defined verbs.

 

Verb Name (alias)
Action
Comments
Backup (ba)
Stores data by replicating it.
For this action, do not use verbs such as Save, Burn, Replicate, or Sync.
Creates a snapshot of the current state of the data or of its configuration.
For this action, do not use a verb such as Diff.
Compare (cr)
Evaluates the data from one resource against the data from another resource.
For this action, do not use a verb such as Diff.
Compacts the data of a resource. Pairs with Expand.
For this action, do not use a verb such as Compact.
Convert (cv)
Changes the data from one representation to another when the cmdlet supports bidirectional conversion or when the cmdlet supports conversion between multiple data types.
For this action, do not use verbs such as Change, Resize, or Resample.
Converts one primary type of input (the cmdlet noun indicates the input) to one or more supported output types.
For this action, do not use verbs such as Export, Output, or Out.
Converts from one or more types of input to a primary output type (the cmdlet noun indicates the output type).
For this action, do not use verbs such as Import, Input, or In.
Detaches a named entity from a location. This verb is paired with Mount.
For this action, do not use verbs such as Unmount or Unlink.
Edit (ed)
Modifies existing data by adding or removing content.
For this action, do not use verbs such as Change, Update, or Modify for this action.
Expand (en)
Restores the data of a resource that has been compressed to its original state. This verb is paired with Compress.
For this action, do not use verbs such as Explode or Uncompress.
Export (ep)
Encapsulates the primary input into a persistent data store, such as a file, or into an interchange format. This verb is paired with Import.
For this action, do not use verbs such as Extract or Backup.
Group (gp)
Arranges or associates one or more resources.
For this action, do not use verbs such as Aggregate, Arrange, Associate, or Correlate.
Import (ip)
Creates a resource from data that is stored in a persistent data store (such as a file) or in an interchange format. For example, the Import-CSV cmdlet imports data from a comma-separated value (CSV) file to objects that can be used by other cmdlets. This verb is paired with Export.
For this action, do not use verbs such as BulkLoad or Load.
Initialize (in)
Prepares a resource for use, and sets it to a default state.
For this action, do not use verbs such as Erase, Init, Renew, Rebuild, Reinitialize, or Setup.
Limit (l)
Applies constraints to a resource.
For this action, do not use a verb such as Quota.
Merge (mg)
Creates a single resource from multiple resources.
For this action, do not use verbs such as Combine or Join.
Mount (mt)
Attaches a named entity to a location. This verb is paired with Dismount.
For this action, do not use the verb Connect.
Out (o)
Sends data out of the environment. For example, the Out-Printer cmdlet sends data to a printer.
Publish (pb)
Makes a resource available to others. This verb is paired with Unpublish.
For this action, do not use verbs such as Deploy, Release, or Install.
Restore (rr)
Sets a resource to a predefined state, such as a state set by Checkpoint. For example, theRestore-Computer cmdlet starts a system restore on the local computer.
For this action, do not use verbs such as Repair, Return, Undo, or Fix.
Save (sv)
Preserves data to avoid loss.
Sync (sy)
Assures that two or more resources are in the same state.
For this action, do not use verbs such as Replicate, Coerce, or Match.
Makes a resource unavailable to others. This verb is paired with Publish.
For this action, do not use verbs such as Uninstall, Revert, or Hide.
Update (ud)
Brings a resource up-to-date to maintain its state, accuracy, conformance, or compliance. For example, the Update-FormatData cmdlet updates and adds formatting files to the current Windows PowerShell console.
For this action, do not use verbs such as Refresh, Renew, Recalculate, or Re-index.


Diagnostic Verbs

Windows PowerShell uses the VerbsDiagnostic class to define actions that apply to diagnostics. The following table lists most of the defined verbs.

 

Verb (alias)
Action
Comments
Debug(db)
Examines a resource to diagnose operational problems.
For this action, do not use a verb such as Diagnose.
Measure(ms)
Identifies resources that are consumed by a specified operation, or retrieves statistics about a resource.
For this action, do not use verbs such as Calculate, Determine, or Analyze.
Ping (pi)
Use the Test verb.
Repair(rp)
Restores a resource to a usable condition
For this action, do not use verbs such as Fix or Restore.
Resolve(rv)
Maps a shorthand representation of a resource to a more complete representation.
For this action, do not use verbs such as Expand or Determine.
Test (t)
Verifies the operation or consistency of a resource.
For this action, do not use verbs such as Diagnose, Analyze, Salvage, or Verify.
Trace(tr)
Tracks the activities of a resource.
For this action, do not use verbs such as Track, Follow, Inspect, or Dig.


Lifecycle Verbs

Windows PowerShell uses the VerbsLifeCycle class to define actions that apply to the lifecycle of a cmdlet. The following table lists most of the defined verbs.

 

Verb (alias)
Action
Comments
Approve(ap)
Confirms or agrees to the status of a resource or process.
Assert (as)
Affirms the state of a resource.
For this action, do not use a verb such as Certify.
Concludes an operation.
Confirm(cn)
Acknowledges, verifies, or validates the state of a resource or process.
For this action, do not use verbs such as Acknowledge, Agree, Certify, Validate, or Verify.
Deny (dn)
Refuses, objects, blocks, or opposes the state of a resource or process.
For this action, do not use verbs such as Block, Object, Refuse, or Reject.
Configures a resource to an unavailable or inactive state. For example, theDisable-PSBreakpoint cmdlet makes a breakpoint inactive. This verb is paired with Enable.
For this action, do not use verbs such as Halt or Hide.
Enable (e)
Configures a resource to an available or active state. For example, the Enable-PSBreakpoint cmdlet makes a breakpoint active. This verb is paired withDisable.
For this action, do not use verbs such as Start or Begin.
Install (is)
Places a resource in a location, and optionally initializes it. This verb is paired with Uninstall.
For this action, do not a use verb such as Setup.
Invoke (i)
Performs an action, such as running a command or a method.
For this action, do not use verbs such as Run or Start.
Creates an entry for a resource in a repository such as a database. This verb is paired with Unregister.
Request(rq)
Asks for a resource or asks for permissions.
Restart(rt)
Stops an operation and then starts it again. For example, the Restart-Servicecmdlet stops and then starts a service.
For this action, do not use a verb such as Recycle.
Resume(ru)
Starts an operation that has been suspended. For example, the Resume-Servicecmdlet starts a service that has been suspended. This verb is paired withSuspend.
Start (sa)
Initiates an operation. For example, the Start-Service cmdlet starts a service. This verb is paired with Stop.
For this action, do not use verbs such as Launch, Initiate, or Boot.
Stop (sp)
Discontinues an activity. This verb is paired with Start.
For this action, do not use verbs such as End, Kill, Terminate, or Cancel.
Submit(sb)
Presents a resource for approval.
For this action, do not use a verb such as Post.
Suspend(ss)
Pauses an activity. For example, the Suspend-Service cmdlet pauses a service. This verb is paired with Resume.
For this action, do not use a verb such as Pause.
Removes a resource from an indicated location. This verb is paired with Install.
Removes the entry for a resource from a repository. This verb is paired withRegister.
For this action, do not use a verb such as Remove.
Wait (w)
Pauses an operation until a specified event occurs. For example, the Wait-PSJob cmdlet pauses operations until one or more of the background jobs are complete.
For this action, do not use verbs such as Sleep or Pause.


Security Verbs

Windows PowerShell uses the VerbsSecurity class to define actions that apply to security. The following table lists most of the defined verbs.

 

Verb (alias)
Action
Comments
Block (bl)
Restricts access to a resource. This verb is paired with Unblock.
For this action, do not use verbs such as Prevent, Limit, or Deny.
Grant (gr)
Allows access to a resource. This verb is paired with Revoke.
For this action, do not use verbs such as Allow or Enable.
Protect(pt)
Safeguards a resource from attack or loss. This verb is paired with Unprotect.
For this action, do not use verbs such as Encrypt, Safeguard, or Seal.
Revoke(rk)
Specifies an action that does not allow access to a resource. This verb is paired with Grant.
For this action, do not use verbs such as Remove or Disable.
Unblock(ul)
Removes restrictions to a resource. This verb is paired with Block.
For this action, do not use verbs such as Clear or Allow.
Removes safeguards from a resource that were added to prevent it from attack or loss. This verb is paired with Protect.
For this action, do not use verbs such as Decrypt or Unseal.


Other Verbs

Windows PowerShell uses the VerbsOther class to define canonical verb names that do not fit into a specific verb name category such as the common, communications, data, lifecycle, or security verb names verbs.

 

Verb (alias)
Action
Comments
Use (u)
Uses or includes a resource to do something.


Bonne lecture ;)

Virtual87