120 private links
The central repository for sharing and acquiring PowerShell code including PowerShell modules, scripts, and DSC resources.
Microsoft announced the next version of PowerShell Core this week. The next version will be PowerShell 7 and not PowerShell Core 6.3 as many expected. It signals a significant change in the development of PowerShell as Microsoft makes another important step in replacing the trusted PowerShell 5.1 on Windows with PowerShell Core.
Si vous souhaitez qu'un script PowerShell s'exécute en arrière-plan et façon continue sur votre serveur, et qu'il démarre automatiquement lorsque vous lors d'un (re)démarrage, exécuter le script en tant que service Windows est une bonne solution. Il devient aisé de faire tourner un script 24/7 🙂
Pour parvenir à créer un service qui exécute un script PS1, on va s'appuyer sur un outil très pratique : NSSM (Non-Sucking Service Manager). Un peu dans le même esprit que l'outil intégré SRVANY intégré à Windows. Le site officiel : NSSM
En guise d'exemple, je vais exécuter un script qui surveille un dossier et qui m'envoie un e-mail s'il y a un changement sur un fichier contenu dans ce dossier (création / modification / suppression). D'ailleurs, je vous propose un article sur le sujet pour la fin de semaine prochaine.
PowerShell Remoting lets you run PowerShell commands or access full PowerShell sessions on remote Windows systems. It’s similar to SSH for accessing remote terminals on other operating systems.