Skip to content

Add NewLine

dscbot edited this page May 29, 2024 · 2 revisions

Add-NewLine

SYNOPSIS

Adds a new line at the end of a file.

SYNTAX

Add-NewLine -FileInfo <FileInfo> [-AtEndOfFile] [<CommonParameters>]

DESCRIPTION

The Add-NewLineAtEndOfFile function adds a new line at the end of the specified file.

EXAMPLES

EXAMPLE 1

Add-NewLineAtEndOfFile -FileInfo "C:\path\to\file.txt" -AtEndOfFile

Adds a new line at the end of the file located at "C:\path\to\file.txt" without prompting for confirmation.

PARAMETERS

-AtEndOfFile

Specifies that the new line should be added to the end of the file.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-FileInfo

Specifies the file to which the new line will be added.

Type: FileInfo
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

[System.IO.FileInfo]

Accepts a FileInfo object representing the file to which the new line will be added.

OUTPUTS

None. The function does not generate any output.

NOTES

RELATED LINKS