Search code examples
powershellno-op

No operation command


With Bash, you have the command :

Null command.

No effect; the command does nothing.

Exit Status:
Always succeeds.

Example

: 'foo'

Does PowerShell have something similar to this?


Solution

  • With the above example, the ForEach-Object alias % works

    % 'foo'
    

    Or

    function : {}
    : 'foo'
    

    Or

    [void] 'foo'
    

    PowerShell Data Types