Unregister-PSResourceRepository
Menghapus repositori terdaftar dari komputer lokal.
Sintaks
Unregister-PSResourceRepository
[-Name] <String[]>
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Deskripsi
Cmdlet menghapus repositori terdaftar dari komputer lokal.
Contoh
Contoh 1
Dalam contoh ini menghapus PSGv3
repositori dari komputer lokal.
Get-PSResourceRepository
Name Uri Trusted Priority
---- --- ------- --------
PSGallery https://www.powershellgallery.com/api/v2 True 10
Local file:///D:/PSRepoLocal/ True 20
PSGv3 https://www.powershellgallery.com/api/v3 True 50
Unregister-PSResourceRepository -Name PSGv3
Get-PSResourceRepository
Name Uri Trusted Priority
---- --- ------- --------
PSGallery https://www.powershellgallery.com/api/v2 True 10
Local file:///D:/PSRepoLocal/ True 20
Contoh 2
Contoh ini menunjukkan cara menghapus beberapa repositori terdaftar dalam satu perintah. Parameter Nama menerima array yang berisi nama repositori yang akan dihapus.
Get-PSResourceRepository
Name Uri Trusted Priority
---- --- ------- --------
PoshTestGallery https://www.poshtestgallery.com/api/v2 True 40
PSGallery https://www.powershellgallery.com/api/v2 False 50
psgettestlocal file:///c:/code/testdir True 50
Unregister-PSResourceRepository -Name PoshTestGallery, psgettestlocal
Get-PSResourceRepository
Name Uri Trusted Priority
---- --- ------- --------
PSGallery https://www.powershellgallery.com/api/v2 False 50
Parameter
-Confirm
Meminta Anda mengonfirmasi sebelum menjalankan cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Nama satu atau beberapa repositori yang akan dihapus.
Type: | String[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PassThru
Ketika ditentukan, menghasilkan objek PSRepositoryInfo untuk setiap repositori yang dihapus.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Menunjukkan yang akan terjadi jika cmdlet dijalankan. Cmdlet tidak dijalankan.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Input
String[]
Output
Microsoft.PowerShell.PSResourceGet.UtilClasses.PSRepositoryInfo
Secara default, cmdlet tidak mengembalikan objek apa pun. Saat parameter PassThru digunakan, cmdlet menghasilkan objek PSRepositoryInfo untuk setiap repositori yang dihapus.
Link Terkait
PSResourceGet
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk