Note
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier les répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de changer de répertoire.
L’objet ISEFileCollection est une collection d’objets ISEFile . Un exemple est la $psISE.CurrentPowerShellTab.Files collection.
Méthodes
Add( [FullPath] )
Pris en charge sous Windows PowerShell ISE 2.0 et versions ultérieures.
Crée et renvoie un nouveau fichier sans titre et l’ajoute à la collection. La propriété IsUntitled du nouveau fichier créé est $true.
- [FullPath] - Chaîne optionnelle - Le chemin entièrement spécifié du fichier. Une exception est générée si vous incluez le paramètre FullPath et un chemin relatif, ou si vous utilisez un nom de fichier au lieu du chemin complet.
# Adds a new untitled file to the collection of files in the current PowerShell tab.
$newFile = $psISE.CurrentPowerShellTab.Files.Add()
# Adds a file specified by its full path to the collection of files in the current
# PowerShell tab.
$psISE.CurrentPowerShellTab.Files.Add("$PSHOME\Examples\profile.ps1")
Remove( File, [Force] )
Pris en charge sous Windows PowerShell ISE 2.0 et versions ultérieures.
Supprime un fichier spécifié de l’onglet PowerShell actuel.
Fichier - Chaîne Le fichier ISEFile que vous souhaitez retirer de la collection. Si le fichier n’a pas été sauvegardé, cette méthode crée une exception. Utilisez le paramètre Force switch pour forcer la suppression d’un fichier non enregistré.
[Force] - Booléen optionnel Si défini sur $true, accorde la permission de supprimer le fichier même s’il n’a pas été sauvegardé après la dernière utilisation. La valeur par défaut est $false.
# Removes the first opened file from the file collection associated with the current
# PowerShell tab. If the file hasn't yet been saved, then an exception is generated.
$firstfile = $psISE.CurrentPowerShellTab.Files[0]
$psISE.CurrentPowerShellTab.Files.Remove($firstfile)
# Removes the first opened file from the file collection associated with the current
# PowerShell tab, even if it hasn't been saved.
$firstfile = $psISE.CurrentPowerShellTab.Files[0]
$psISE.CurrentPowerShellTab.Files.Remove($firstfile, $true)
SetSelectedFile( selectedFile )
Pris en charge sous Windows PowerShell ISE 2.0 et versions ultérieures.
Sélectionne le fichier spécifié par le paramètre SelectedFile .
Fichier sélectionné - Microsoft.PowerShell.Host.ISE.ISEFile Le fichier ISEFile que vous souhaitez sélectionner.
# Selects the specified file.
$firstfile = $psISE.CurrentPowerShellTab.Files[0]
$psISE.CurrentPowerShellTab.Files.SetSelectedFile($firstfile)