< Back

Format-Splat

Mon Jan 13, 2020 7:31 pm

NAME Format-Splat



SYNOPSIS





SYNTAX

Format-Splat [-InputObject] <String> [<CommonParameters>]





DESCRIPTION

formats a function call into a splatted call





PARAMETERS

-InputObject <String>

The text to format into an appropriate splat command



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

System.String





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$text = 'Copy-Item -Path $path -Destination c:\\temp -Force'



PS> Format-Splat $text



$item = @{

Path = $path

Destination = 'c:\\temp'

Force = $true

}

Copy-Item @item











RELATED LINKS