Main | Contact | Blog | Documentation

PowerShell Framework

The project dedicated to empowering your PowerShell scripting.

New-PSFTempDirectory

SYNOPSIS

Create a temporary directory / folder.

SYNTAX

New-PSFTempDirectory [-Name] <String> [[-DirectoryName] <String>] [[-Timeout] <DateTimeParameter>]
 [[-ModuleName] <String>] [<CommonParameters>]

DESCRIPTION

Create a temporary directory / folder.

EXAMPLES

EXAMPLE 1

New-PSFTempDirectory -Name 'zipFolder'

Creates a temporary directory item named ‘zipFolder’

PARAMETERS

-Name

Name of the temporary directory item. Note: The actual foldername will be autogenerated and ignore this value.

Type: String
Parameter Sets: (All)
Aliases:

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

-DirectoryName

Specify the exact name of the temporary directory to generate. By default, a generic name is autogenerated instead.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Timeout

How long into the future this item is valid. Expired temporary items can be conveniently cleaned up using Remove-PSFTempItem.

Type: DateTimeParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ModuleName

Name of the module the temp item belongs to. If called from within a module, this value will be detected automatically and needs not be specified.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: [PSFramework.Utility.UtilityHost]::GetCallerInfo(1).CallerModule
Accept pipeline input: False
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

OUTPUTS

System.String

NOTES