background preloader

PowerShell

Facebook Twitter

Re:foreach - Bienvenue sur le forum PowerShell-Scripting.com. Cleaning Hard Drives and Finding Folders Total Size - Dreaming in PowerShell. Hard drives these days are huge, and still they run out of space all too soon.

Cleaning Hard Drives and Finding Folders Total Size - Dreaming in PowerShell

So maybe you'd like to find out where the storage hogs are located and which folder wastes the most space. Or, you need to manage user profiles and would like to find out just how much space each consumes. File Directory listing with size. Squeekie replied on 07-26-2011 8:39 AM Tobias, Great post, I've used it before and I had lost where I stored it.

File Directory listing with size

I have ran through it and I like the output. Now I need to be able to query remote servers with using your block. Rather than specifying where to query, in your example $home, I tried C:\ and worked just fine. What is the proper method to pass the server name and drive letter you want to query against in order to get the same result? The output should be like this: Servername Path Count Size. Re:foreach - Bienvenue sur le forum PowerShell-Scripting.com. Re:Taille d'un dossier - Bienvenue sur le forum PowerShell-Scripting.com. Je n'ai pas l'impression qu'il y ait une méthode directe.

Re:Taille d'un dossier - Bienvenue sur le forum PowerShell-Scripting.com

L'Explorateur lui-même repose sur un comptage fichier par fichier. Pour qu'il y ait une méthode directe, il faudrait qu'un compteur soit automatiquement incrémenté au niveau de chaque répertoire de chaque arborescence à chaque fois qu'un fichier est ajouté, modifié ou supprimé n'importe où dans l'arborescence, ce dont je doute. J'ai essayé rapidement deux autres méthodes, mais elles ont donné des résultats plus lents sur mon poste. Regarde si éventuellement ça marche mieux chez toi: [PowerShell] Comment optimiser get-childitem pour ne pas parcourir tout un repertoire ? Re:Surveillance répertoire et sous repertoires + m - Bienvenue sur le forum PowerShell-Scripting.com. Bonjour, On ma demandé de remonter par mail toutes modifications dans un repertoire et ses sous repertoires.

Re:Surveillance répertoire et sous repertoires + m - Bienvenue sur le forum PowerShell-Scripting.com

Travaillant habituellement en bat, j'ai vite compris que j'avais pas fini. Récupérer la taille d’un Objet en Powershell. Script Get-FolderSize. Verified on the following platforms This script is tested on these platforms by the author.

Script Get-FolderSize

It is likely to work on other platforms as well. If you try it and find that it works on another platform, please add a note to the script discussion to let others know. Online peer support For online peer support, join The Official Scripting Guys Forum! To provide feedback or report bugs in sample scripts, please start a new discussion on the Discussions tab for this script. Disclaimer The sample scripts are not supported under any Microsoft standard support program or service. Script Size of Folder and subfolders. Verified on the following platforms This script is tested on these platforms by the author.

Script Size of Folder and subfolders

It is likely to work on other platforms as well. If you try it and find that it works on another platform, please add a note to the script discussion to let others know. Online peer support For online peer support, join The Official Scripting Guys Forum! To provide feedback or report bugs in sample scripts, please start a new discussion on the Discussions tab for this script. Script Folder Size Calculation. Verified on the following platforms This script is tested on these platforms by the author.

Script Folder Size Calculation

It is likely to work on other platforms as well. If you try it and find that it works on another platform, please add a note to the script discussion to let others know. Online peer support For online peer support, join The Official Scripting Guys Forum! To provide feedback or report bugs in sample scripts, please start a new discussion on the Discussions tab for this script. Disclaimer The sample scripts are not supported under any Microsoft standard support program or service.

Powershell : Supprimer les applications par défaut dans Windows 8. Via PowerShell » New-PSDrive, FileSystem et Credentials : Enfin ! Il existe plusieurs solutions pour monter des ressources réseau via PowerShell.

via PowerShell » New-PSDrive, FileSystem et Credentials : Enfin !

Il y a maintenant plus d’un an, j’avais présenté une solution, sur mon blog, dans cet article. Cette solution consiste à utiliser un objet COM : Une autre approche est d’utiliser simplement la commande « net use »: Script Get Network Information of Local and Remote Computer using PowerShell. Verified on the following platforms This script is tested on these platforms by the author.

Script Get Network Information of Local and Remote Computer using PowerShell.

It is likely to work on other platforms as well. If you try it and find that it works on another platform, please add a note to the script discussion to let others know. Online peer support For online peer support, join The Official Scripting Guys Forum! To provide feedback or report bugs in sample scripts, please start a new discussion on the Discussions tab for this script. Ordinateurs connectés au réseau complet Scripting Windows. Re:Récupération infos réseaux - Bienvenue sur le forum PowerShell-Scripting.com. Détecter si une machine est connectée à internet. [PowerShell] Fichier output d'un script PS vide.

Chapter 4. Arrays and Hashtables - Master-PowerShell. Whenever a command returns more than one result, PowerShell will automatically wrap the results into an array.

Chapter 4. Arrays and Hashtables - Master-PowerShell

So dealing with arrays is important in PowerShell. In this chapter, you will learn how arrays work. We will cover simple arrays and also so-called "associative arrays," which are also called "hash tables. " Topics Covered: PowerShell Commands Return Arrays If you store the result of a command in a variable and then output it, you might at first think that the variable contains plain text: $a = ipconfig$a Windows IP ConfigurationEthernet adapter LAN Connection Media state. With Dr. Tobias Weltner - Powershell.com – Powershell Scripts, Tips and Resources. Whenever a command returns more than one result, PowerShell will automatically wrap the results into an array. So dealing with arrays is important in PowerShell. In this chapter, you will learn how arrays work. We will cover simple arrays and also so-called "associative arrays," which are also called "hash tables.

" Topics Covered: PowerShell Commands Return Arrays If you store the result of a command in a variable and then output it, you might at first think that the variable contains plain text: Re:importer et modifier un csv - Bienvenue sur le forum PowerShell-Scripting.com. Create Log File in Powershell. Articles / Tutoriaux.

Using PowerShell to Query Web Site Information. In my last post, I showed you how to use the Test-Connection cmdlet to test your internet access. In this post, I can show you how to use Net.WebRequest or the Net.WebClient to send a request to website and verify if you have internet access or not. There is more you can do with these other than just testing Internet access or testing that a website is currently up and running, but that is beyond the scope of that I am going to show you here. Net.WebClient Class The first class I will show is the Net.WebClient class to access a web page.

Using this class and its associated methods will actually download the source page of the website. First off, lets create the object using the Net.WebClient class and view those methods. Les bases de PowerShell. WebClient Class (System.Net) Provides common methods for sending data to and receiving data from a resource identified by a URI. [ComVisibleAttribute(true)] public class WebClient : Component The WebClient type exposes the following members. The WebClient class provides common methods for sending data to or receiving data from any local, intranet, or Internet resource identified by a URI.

The following table describes WebClient methods for uploading data to a resource. The following table describes WebClient methods for downloading data from a resource. Notes to Inheritors Derived classes should call the base class implementation of WebClient to ensure the derived class works as expected. Accueil. J’étais en formation C# ces derniers jours et comme c’est encore frais dans ma tête, j’ai envie de partager avec vous mon ressenti… Voilà donc chose faite à travers ce billet. Bien que le langage C# soit très puissant, je dois avouer que j’ai été effaré de constater toute la difficulté et les efforts qu’il faut déployer pour réaliser des choses qui somme toute, semblent relativement simples.

Je pèse mes mots en disant “semblent” car programmer dans un langage de programmation “de haut niveau” n’est pas toujours chose facile. J’ai conscience qu’on ne fait pas les mêmes choses avec C# et PowerShell, je veux dire qu’à chaque usage il existe une technologie adaptée. En effet, bien que possible, il ne serait pas souhaitable d’utiliser PowerShell pour développer une application de gestion connectée a une base de données. Bref, aujourd’hui j'ai passé la majeure partie de l’après-midi à jouer avec les Services Web (création et “consommation”).