Set-FileIntegrity
Set-FileIntegrity
Sets integrity for a file on an ReFS volume.
Sintaxis
Parameter Set: Set1
Set-FileIntegrity [-FileName] <String> [[-Enable] <Boolean> ] [-AsJob] [-CimSession <CimSession[]> ] [-Enforce <Boolean> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Descripción detallada
The Set-FileIntegrity cmdlet sets integrity for a file on a Resilient File System (ReFS) volume. You can enable or disable integrity.
Parámetros
-AsJob
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-CimSession<CimSession[]>
Ejecuta el cmdlet en una sesión remota o en un equipo remoto. Escriba un nombre de equipo o un objeto de sesión, como la salida de un cmdlet New-CimSession o Get-CimSession. El valor predeterminado es la sesión actual en el equipo local.
Alias |
Session |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-Enable<Boolean>
Indicates whether to enable integrity for the file.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
2 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-Enforce<Boolean>
Indicates whether to enable blocking access to a file if integrity streams do not match the data.
If you specify a value of $True for this parameter, the cmldet also enables integrity for the file.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-FileName<String>
Specifies a file name. The cmdlet modifies integrity for the file that you specify.
Alias |
FullName |
¿Requerido? |
true |
¿Posición? |
1 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-ThrottleLimit<Int32>
Especifica el número máximo de operaciones simultáneas que se pueden establecer para ejecutar el cmdlet. Si se omite este parámetro o es especifica un valor de 0
, Windows PowerShell ® calcula un límite óptimo para el cmdlet en función del número de cmdlets de CIM que se estén ejecutando en el equipo. El límite solo se aplica al cmdlet actual, no a la sesión ni al equipo.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-Confirm
Solicita confirmación antes de ejecutar el cmdlet.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-WhatIf
Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
<CommonParameters>
Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Entradas
El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.
-
To obtain a FileInfo object, use the Get-Item cmdlet for a specified file name. The cmdlet uses the FullName property as the value of the FileName parameter.
-
To obtain a DirectoryInfo object, use Get-Item for a specified directory name. The cmdlet uses the FullName property as the value of the FileName parameter.
Salidas
El tipo de resultado es el tipo de objetos que emite el cmdlet.
- This cmdlet generates no output.
Ejemplos
Example 1: Enable integrity
The first command enables integrity for a file by specifying the Enable parameter.
The second command uses the Get-FileIntegrity cmdlet to display the file integrity settings for the specified file.
PS C:\> Set-FileIntegrity -FileName 'H:\Temp\New Text Document.txt' -Enable $True
PS C:\> Get-FileIntegrity 'H:\Temp\New Text Document.txt'
Example 2: Enable integrity for multiple files by using the pipeline
The first command uses the Get-Item cmdlet to get all the files in the specified folder, and then passes them to the current cmdlet by using the pipeline operator. For more information, type Get-Help Get-Item
. The command enables integrity for each file in the directory.
The second command uses Get-Item to get all the files in the specified folder, and then passes them to the Get-FileIntegrity by using the pipeline operator. The command displays the file integrity setting for all the files in the folder.
PS C:\> Get-Item -Path 'H:\Temp\*' | Set-FileIntegrity -Enable $True
PS C:\> Get-Item -Path 'H:\Temp\*' | Get-FileIntegrity