| external help file | PSCompression.dll-Help.xml |
|---|---|
| Module Name | PSCompression |
| online version | https://github.com/santisq/PSCompression |
| schema | 2.0.0 |
Lists entries from RAR archives, supporting file paths and input streams.
Get-RarEntry
[-Path] <String[]>
[-Type <EntryType>]
[-Include <String[]>]
[-Exclude <String[]>]
[<CommonParameters>]Get-RarEntry
-LiteralPath <String[]>
[-Type <EntryType>]
[-Include <String[]>]
[-Exclude <String[]>]
[<CommonParameters>]Get-RarEntry
[-InputStream] <Stream>
[-Type <EntryType>]
[-Include <String[]>]
[-Exclude <String[]>]
[<CommonParameters>]The Get-RarEntry cmdlet lists entries in RAR archives. It accepts input from file paths and streams, and outputs RarEntry objects that can be piped to cmdlets like Expand-RarEntry and Get-RarEntryContent. The cmdlet uses SharpCompress for RAR archive processing.
PS /> Get-RarEntry .\archive.rar
Directory: /folder1/
Type LastWriteTime CompressedSize Size Name
---- ------------- -------------- ---- ----
Directory 2026-09-29 2:00 PM folder1
Archive 2026-09-29 2:00 PM 450.00 B 1.00 KB file1.txt
Archive 2026-09-29 2:00 PM 900.00 B 2.00 KB file2.txtThis example lists all entries in archive.rar.
PS /> Get-RarEntry *.rarThis example lists entries from all RAR archives in the current directory using wildcard matching.
PS /> Get-RarEntry .\archive.rar -Type Archive
Directory: /folder1/
Type LastWriteTime CompressedSize Size Name
---- ------------- -------------- ---- ----
Archive 2026-09-29 2:00 PM 450.00 B 1.00 KB file1.txt
Archive 2026-09-29 2:00 PM 900.00 B 2.00 KB file2.txtThis example lists only file entries (excluding directories) from archive.rar using -Type Archive.
PS /> Get-RarEntry .\archive.rar -Include folder1/* -Exclude *.txt
Directory: /folder1/
Type LastWriteTime CompressedSize Size Name
---- ------------- -------------- ---- ----
Directory 2026-09-29 2:00 PM folder1
Archive 2026-09-29 2:00 PM 1.20 KB 3.00 KB image.pngThis example lists entries under folder1/ while excluding any .txt files.
Note
Inclusion and exclusion patterns are applied to the entries' relative paths. Exclusions are applied after inclusions.
PS /> $stream = Invoke-WebRequest https://example.com/archive.rar
PS /> $stream | Get-RarEntry | Select-Object -First 3
Directory: /docs/
Type LastWriteTime CompressedSize Size Name
---- ------------- -------------- ---- ----
Directory 2026-09-29 2:00 PM docs
Archive 2026-09-29 2:00 PM 600.00 B 1.50 KB readme.md
Archive 2026-09-29 2:00 PM 1.00 KB 2.50 KB license.txtThis example lists the first three entries from a RAR archive stream retrieved via a web request.
Specifies an array of string patterns to match as the cmdlet lists entries. Matching entries are excluded from the output. Wildcard characters are supported.
Note
Inclusion and exclusion patterns are applied to the entries' relative paths. Exclusions are applied after inclusions.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueSpecifies an array of string patterns to match as the cmdlet lists entries. Matching entries are included in the output. Wildcard characters are supported.
Note
Inclusion and exclusion patterns are applied to the entries' relative paths. Exclusions are applied after inclusions.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: TrueSpecifies an input stream containing a RAR archive.
Tip
Output from Invoke-WebRequest is automatically bound to this parameter.
Type: Stream
Parameter Sets: Stream
Aliases: RawContentStream
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: FalseSpecifies one or more paths to RAR archives. The value is used exactly as typed, with no wildcard character interpretation.
Type: String[]
Parameter Sets: LiteralPath
Aliases: PSPath
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseSpecifies one or more paths to RAR archives. Wildcard characters are supported.
Type: String[]
Parameter Sets: Path
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: TrueFilters output to include only files (Archive) or only directories (Directory).
Type: EntryType
Parameter Sets: (All)
Aliases:
Accepted values: Directory, Archive
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters. For more information, see about_CommonParameters.
You can pipe a stream containing a RAR archive to this cmdlet, such as output from Invoke-WebRequest.
You can pipe strings containing paths to RAR archives, such as output from Get-ChildItem or Get-Item.
Outputs RarEntry objects representing files or directories in the RAR archive.