Obtener la ruta relativa de los archivos en las subcarpetas desde el directorio actual
¿Hay alguna forma directa (mediante el uso de cmdlets o clases. NET) de obtener solo la ruta relativa de un archivo en una subcarpeta desde una ruta dada?
Por ejemplo, la carpeta actual es C:\MyScript y hay una subcarpeta llamada "Datos" con una prueba de archivo".txt", así que me gustaría ver Data \ Test.txt en lugar de C:\MyScript\Data\Test.txt
38
Author: blue18hutthutt, 2012-06-11
1 answers
El cmdlet Resolve-Path
tiene un parámetro -Relative
que devolverá una ruta relativa al directorio actual:
Set-Location C:\MyScript
$relativePath = Get-Item Data\Test.txt | Resolve-Path -Relative
66
Author: Aaron Jensen,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-06-11 05:07:10
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-06-11 05:07:10