Some work
This commit is contained in:
parent
fc1b3c0314
commit
d62aee5590
1 changed files with 83 additions and 48 deletions
|
|
@ -209,53 +209,88 @@ function ConvertFrom-Base64UTF8($base64) {
|
||||||
return [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($base64))
|
return [System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($base64))
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-TFSWorkspace(
|
# XBOX HELPER FUNCTIONS
|
||||||
[string]$path = ((pwd).Path)
|
|
||||||
)
|
function Get-XboxDeployedPackageInfo()
|
||||||
{
|
{
|
||||||
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Client")
|
xbrun /o reg query '\"HKU\S-1-5-21-2702878673-795188819-444038987-501\Software\Classes\Local Settings\Software\microsoft\windows\currentversion\appmodel\repository\packages"' /s
|
||||||
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.VersionControl.Client")
|
}
|
||||||
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.WorkItemTracking.Client")
|
|
||||||
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Build.Client")
|
# function Get-XboxConnectedAddresses()
|
||||||
|
# {
|
||||||
function InitServerAndWorkspaceFromWSInfo( $wsInfo )
|
# $addrs = @{}
|
||||||
{
|
|
||||||
$tfs = New-Object Microsoft.TeamFoundation.Client.TfsTeamProjectCollection( $wsInfo.ServerUri )
|
# $results = xbconnect
|
||||||
$versionControlServer = $tfs.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer])
|
# $reading = $false
|
||||||
|
# foreach($line in $results)
|
||||||
return @{
|
# {
|
||||||
"BuildServer"= $tfs.GetService([Microsoft.TeamFoundation.Build.Client.IBuildServer]);
|
# if ($line.IndexOf("XBTP connections") -ge 0)
|
||||||
"VersionControl"=$versionControlServer;
|
# {
|
||||||
"WorkItems"=$tfs.GetService([Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore]);
|
# $reading = $true
|
||||||
"Workspace"=$versionControlServer.GetWorkspace($wsInfo);
|
# }
|
||||||
}
|
# elseif ($reading)
|
||||||
}
|
# {
|
||||||
|
# $parts = $line.Split(@(' '), 'RemoveEmptyEntries')
|
||||||
# is there only 1 workspace in our cache file? If so, use that one regardless of the hint
|
# $key = $parts[0].Substring(0, $parts[0].Length - 1)
|
||||||
$workspaceInfos = [Microsoft.TeamFoundation.VersionControl.Client.Workstation]::Current.GetAllLocalWorkspaceInfo()
|
# $value = $parts[1]
|
||||||
if ($workspaceInfos.Length -eq 1)
|
# if ($value -eq 'Unreachable.')
|
||||||
{
|
# {
|
||||||
InitServerAndWorkspaceFromWSInfo($workspaceInfos[0])
|
# continue
|
||||||
return
|
# }
|
||||||
}
|
|
||||||
|
# $addrs[$key] = $value
|
||||||
$current = $path
|
# }
|
||||||
do
|
# }
|
||||||
{
|
|
||||||
$workspaceInfos = [Microsoft.TeamFoundation.VersionControl.Client.Workstation]::Current.GetLocalWorkspaceInfoRecursively($current)
|
# return $addrs
|
||||||
if ($workspaceInfos.Length -gt 1)
|
# }
|
||||||
{
|
|
||||||
throw 'More than one workspace matches the workspace hint "{0}": {1}' -f
|
function Connect-XboxHostTelnet()
|
||||||
$current, [string]::join(', ', @($workspaceInfos | %{ $_.Name}))
|
{
|
||||||
}
|
$addr = xbconnect -b
|
||||||
|
telnet $addr
|
||||||
$current = split-path -parent $current
|
}
|
||||||
} while (($workspaceInfos.Length -ne 1) -and $current)
|
|
||||||
|
function Invoke-XboxHost($command)
|
||||||
if (-not $workspaceInfos)
|
{
|
||||||
{
|
xbrun /x/host /o $command
|
||||||
throw "Could not figure out a workspace based on $path"
|
}
|
||||||
}
|
|
||||||
|
function Copy-XboxSystemFile($sourceFile, $targetFile)
|
||||||
return InitServerAndWorkspaceFromWSInfo( $workspaceInfos[0] )
|
{
|
||||||
|
Write-Host "Unlinking Host OS and System OS..."
|
||||||
|
Invoke-XboxHost "xvtool -w 1"
|
||||||
|
|
||||||
|
Write-Host "Shutting down System OS..."
|
||||||
|
Invoke-XboxHost "xvtool -s 2"
|
||||||
|
|
||||||
|
Write-Host "Mounting System XVD..."
|
||||||
|
Invoke-XboxHost "xvdutil -m f:\system.xvd"
|
||||||
|
|
||||||
|
Write-Host "Copying file..."
|
||||||
|
xbcp /x/host $sourceFile "Xg:$targetFile"
|
||||||
|
|
||||||
|
Write-Host "Unmounting System XVD..."
|
||||||
|
Invoke-XboxHost "xvdutil -umdn 3"
|
||||||
|
|
||||||
|
Write-Host "Rebooting..."
|
||||||
|
xbreboot /x/host
|
||||||
|
}
|
||||||
|
|
||||||
|
function Connect-XboxSystemKD()
|
||||||
|
{
|
||||||
|
$addr = xbconnect -b
|
||||||
|
windbg -k "net:port=50038,target=$addr"
|
||||||
|
}
|
||||||
|
|
||||||
|
function Connect-XboxGameKD()
|
||||||
|
{
|
||||||
|
$addr = xbconnect -b
|
||||||
|
windbg -k "net:port=50039,target=$addr"
|
||||||
|
}
|
||||||
|
|
||||||
|
function Connect-XboxHostKD()
|
||||||
|
{
|
||||||
|
$addr = xbconnect -b
|
||||||
|
windbg -k "net:port=,target=$addr"
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue