Werbung

Herkunft

Kurzinformation

Creates a new basic script module (.PSM1) from location of the current file

Syntax

<# .Synopsis Creates a new basic script module (.PSM1) from location of the current file .Description Creates a new basic script module (.PSM1) from location of the current file All .ps1 files in the same directory as the current file will be included in the module. Does not overwrite existing modules at this location. .Example New-ScriptModuleFromCurrentLocation #> param() $location = Split-Path $psise.CurrentFile.FullPath $locationName = Split-Path $location -Leaf $text = "" Get-ChildItem $location -Filter *.ps1 | ForEach-Object { $text += ('. $psScriptRoot\' + $_.Name + [Environment]::NewLine) } $modulePath = Join-Path $location "$locationName.psm1" if (Test-Path -ErrorAction SilentlyContinue $modulePath) { return } [IO.File]::WriteAllText($modulePath, $text) $psise.CurrentPowerShellTab.Files.Add($modulePath)

Beschreibung

Creates a new basic script module (.PSM1) from location of the current fileAll .ps1 files in the same directory as the current file will be included in the module.

Does not overwrite existing modules at this location.

Links

Liste aller Commandlets Mehr über die Windows PowerShell

Bücher zur PowerShell

Buchcover Windows PowerShell 5.0 - Das Praxishandbuch (1. Auflage 2016/5. Auflage Gesamtreihe) Windows PowerShell 5.0 - Das Praxishandbuch (1. Auflage 2016/5. Auflage Gesamtreihe)
Autoren: Dr. Holger Schwichtenberg
erschienen 2016, 996 Seiten, 49,99 €
ISBN: 3446446435
Bestellung: Amazon.de oder im Buchhandel über ISBN 3446446435

Schulungen/Seminare

Offene Seminare zur PowerShell
In-House-Seminare zur PowerShell