Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-ContainerHost.ps1 may fail when temp directory path elements are too long #160

Closed
mikejhill opened this issue Mar 7, 2016 · 1 comment

Comments

@mikejhill
Copy link

When temp directory path elements are too long, the Get-Nsmm function within New-ContainerHost.ps1 obtains a path using one or more short names which causes the Remove-Item command to fail.

Related issue on ServerFault

We was able to workaround this issue by making the adjustment on line 1080 as mentioned in the accepted ServerFault answer:
- $nssmZip = "$($env:temp)\$(Split-Path $nssmUri -Leaf)"
+ $nssmZip = [System.IO.Path]::GetFullPath("$($env:temp)\$(Split-Path $nssmUri -Leaf)")

This is the error encountered when paths were long enough for short names to be used:

C:\New-ContainerHost.ps1 : An object at the specified path C:\Users\FILE~1.NAM does not exist.
At line:1 char:1
+ C:\New-ContainerHost.ps1 -VMName docker-hyperv -WindowsImage ServerD ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-ContainerHost.ps1
scooley pushed a commit that referenced this issue Apr 27, 2016
* update quick start

* update quick start

* adding whats new blurb

* adding whats new blurb

* remove perf statement

* quick start split
@neilpeterson
Copy link
Contributor

Assuming this has been resolved with TP5 revision. Will re-open if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants