Skip to content

Set-MemoryMappedFileContent

SYNOPSIS

Writes string content into a memory-mapped file with the given name and path.

SYNTAX

__AllParameterSets

Set-MemoryMappedFileContent [-Name] <string> [-Path] <string> [-Content] <string> [-PassThru]
 [<CommonParameters>]

ALIASES

This cmdlet has the following aliases, {{Insert list of aliases}}

DESCRIPTION

This function writes UTF-8 encoded content into a memory-mapped file at the specified path. It creates or updates the file using the size of the input content. If the -PassThru switch is used, the resulting memory-mapped file object is returned. An internal accessor is used to perform the write operation, and proper disposal is handled in the clean block.

EXAMPLES

EXAMPLE 1

Set-MemoryMappedFileContent -Name "LogMap" -Path "C:\Temp\log.map" -Content "Hello, Memory Map"

Output:

(No output unless -PassThru is specified)

Writes "Hello, Memory Map" to a memory-mapped file named 'LogMap' located at 'C:\Temp\log.map'.

PARAMETERS

-Content

The string content to write into the memory-mapped file.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 2
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Name

The name to assign to the memory-mapped file.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-PassThru

If specified, returns the memory-mapped file object after writing.

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Path

The file system path where the memory-mapped file is stored.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: 1
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

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

INPUTS

System.String

{{ Fill in the Description }}

OUTPUTS

System.IO.MemoryMappedFiles.MemoryMappedFile

{{ Fill in the Description }}

NOTES

Returns the memory-mapped file object when -PassThru is used.