VirtualBox

Changes between Initial Version and Version 1 of Ticket #22159


Ignore:
Timestamp:
Sep 5, 2024 6:06:53 PM (3 months ago)
Author:
agrajagco
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22159 – Description

    initial v1  
    4646I've created the following powershell script and tested against a nested directory structure to make it properly recognizable for the 7.x virtualbox.  It works, but again I do NOT want to reinstrument ACLs around my defaul user home directory on windows (and I would not have selected it on installation, this was a default at some point in my install history it looks like...)
    4747
     48(corrected script uploaded to address parent path having trailing slash properly)
    4849
    4950{{{
    50 # Script: fixpaths.ps1
    51 # Version: 1.1.0
     51# Version: 1.3.0
    5252
    5353# Check if a path was provided as a command-line argument
     
    5757}
    5858
    59 # Get the path from the command-line arguments
    60 $targetPath = $args[0]
     59# Get the path from the command-line arguments and normalize it
     60$targetPath = $args[0].TrimEnd('\')
    6161
    6262# Check if the path exists
     
    6666}
    6767
     68# Normalize the path
     69$targetPath = [System.IO.Path]::GetFullPath($targetPath)
     70
    6871# Get the parent directory
    69 $parentPath = [System.IO.Directory]::GetParent($targetPath).FullName
     72$parentPath = [System.IO.Directory]::GetParent($targetPath)
     73
     74if (-not $parentPath) {
     75    Write-Host "No parent directory found for the specified path."
     76    exit 1
     77}
     78
     79$parentPath = $parentPath.FullName
    7080
    7181# Define the set of commands to be run for each directory
     
    102112
    103113# Run the commands against each child directory
    104 foreach ($child in $childDirectories) {
    105     Run-Commands -path $child.FullName
    106 }
    107 
    108 Write-Host "Completed running commands."
    109114
    110115}}}

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette