The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

PowerShell::Pipeline - Wraps powershell cmdlet pipeline

VERSION

version 1.00

SYNOPSIS

    use PowerShell::Pipeline;

    # Minimally
    my $pipeline = PowerShell::Pipeline->new()
        ->add('Mount-DiskImage', 
            ['Image', 'C:\\tmp\\foo.iso'], 
            ['StorageType', 'ISO'])
        ->add('Get-Volume');
        ->add('Select', ['ExpandProperty', 'Name']);

    # Then execute with powershell
    PowerShell->new($pipeline)->execute();

    # Or just print it out
    print('pipeline [', $pipeline->command(), "]\n");

DESCRIPTION

Represents a pipeline of cmdlets.

CONSTRUCTORS

new()

Creates a new pipeline for cmdlets.

METHODS

add($cmdlet, [@parameters])

Adds $cmdlet to the end of the pipeline. If $cmdlet is a string, it will be passed on to the constructor of PowerShell::Cmdlet and parameter will be called for each of the supplied parameters.

command()

Returns a string form of the pipeline.

AUTHOR

Lucas Theisen <lucastheisen@pastdev.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Lucas Theisen.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

SEE ALSO

Please see those modules/websites for more information related to this module.