November 2018
Intermediate to advanced
566 pages
17h 15m
English
We will create a script module with two functions. We will call one function from another. The latter function will be exposed for use. Follow these steps to get started:
function New-FileName { param ( # The name of the file [Parameter(Mandatory=$false)] [string] $Prefix='File', # The number of files to be generated [Parameter(Mandatory=$false, Position=1)] [int] $Count=1 ) begin { $InitCount = 1 } process { while ($InitCount -le $Count) { Write-Output $Prefix$InitCount $InitCount++ } } } function New-File { [CmdletBinding( SupportsShouldProcess=$true, DefaultParameterSetName='File' ...Read now
Unlock full access