- 已编辑
yihui 最新进展:powershell 在我的 win7 里是安装了的,不知怎的,在环境变量里没有它的路径。手动添加路径,就可以在 cmd 里运行 powershell 了。但是,安装仍然出错,说 The term 'Invoke-WebRequest' is not recognized,貌似仍然是 powershell 版本太低的问题:
C:\Users\dapeng\AppData\Local\Temp\RtmpczicSz>where /q powershell || echo powershell not found && exit /b
C:\Users\dapeng\AppData\Local\Temp\RtmpczicSz>rem switch to a temp directory, whichever works
C:\Users\dapeng\AppData\Local\Temp\RtmpczicSz>cd /d "C:\Users\dapeng\AppData\Local\Temp"
C:\Users\dapeng\AppData\Local\Temp>cd /d "C:\Users\dapeng\AppData\Local\Temp"
C:\Users\dapeng\AppData\Local\Temp>cd /d ""
The filename, directory name, or volume label syntax is incorrect.
C:\Users\dapeng\AppData\Local\Temp>rem in case there is a leftover install-tl-* dir, delete it
C:\Users\dapeng\AppData\Local\Temp>for / %G in ("install-tl-*") do rd /s /q "%~G"
C:\Users\dapeng\AppData\Local\Temp>rem download install-tl.zip and unzip it
C:\Users\dapeng\AppData\Local\Temp>powershell -Command "Invoke-WebRequest http://mirror.ctan.org/systems/texlive/tlnet/install-tl.zip -OutFile install-tl.zip"
The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet, functio
n, script file, or operable program. Check the spelling of the name, or if a pa
th was included, verify that the path is correct and try again.
At line:1 char:18
+ Invoke-WebRequest <<<< http://mirror.ctan.org/systems/texlive/tlnet/install-
tl.zip -OutFile install-tl.zip
+ CategoryInfo : ObjectNotFound: (Invoke-WebRequest:String) [], C
ommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
C:\Users\dapeng\AppData\Local\Temp>powershell -Command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('install-tl.zip', '.'); }"
Add-Type : Cannot add type. The assembly 'System.IO.Compression.FileSystem' cou
ld not be found.
At line:1 char:13
+ & { Add-Type <<<< -A 'System.IO.Compression.FileSystem'; [IO.Compression.Zip
File]::ExtractToDirectory('install-tl.zip', '.'); }
+ CategoryInfo : ObjectNotFound: (System.IO.Compression.FileSyste
m:String) [Add-Type], Exception
+ FullyQualifiedErrorId : ASSEMBLY_NOT_FOUND,Microsoft.PowerShell.Commands
.AddTypeCommand
Add-Type : Cannot add type. One or more required assemblies are missing.
At line:1 char:13
+ & { Add-Type <<<< -A 'System.IO.Compression.FileSystem'; [IO.Compression.Zip
File]::ExtractToDirectory('install-tl.zip', '.'); }
+ CategoryInfo : InvalidData: (:) [Add-Type], InvalidOperationExc
eption
+ FullyQualifiedErrorId : ASSEMBLY_LOAD_ERRORS,Microsoft.PowerShell.Comman
ds.AddTypeCommand
Unable to find type [IO.Compression.ZipFile]: make sure that the assembly conta
ining this type is loaded.
At line:1 char:77
+ & { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]
<<<< ::ExtractToDirectory('install-tl.zip', '.'); }
+ CategoryInfo : InvalidOperation: (IO.Compression.ZipFile:String
) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound
C:\Users\dapeng\AppData\Local\Temp>del install-tl.zip
Could Not Find C:\Users\dapeng\AppData\Local\Temp\install-tl.zip
C:\Users\dapeng\AppData\Local\Temp>rem download texlive.profile and modify it (set texdir to ./TinyTeX)
C:\Users\dapeng\AppData\Local\Temp>powershell -Command "Invoke-WebRequest https://github.com/yihui/tinytex/raw/master/tools/texlive.profile -OutFile texlive.profile"
The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet, functio
n, script file, or operable program. Check the spelling of the name, or if a pa
th was included, verify that the path is correct and try again.
At line:1 char:18
+ Invoke-WebRequest <<<< https://github.com/yihui/tinytex/raw/master/tools/tex
live.profile -OutFile texlive.profile
+ CategoryInfo : ObjectNotFound: (Invoke-WebRequest:String) [], C
ommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
C:\Users\dapeng\AppData\Local\Temp>powershell -Command "(gc texlive.profile) -replace './', './TinyTex/' | Out-File -encoding ASCII texlive.profile"
Get-Content : Cannot find path 'C:\Users\dapeng\AppData\Local\Temp\texlive.pr
ofile' because it does not exist.
At line:1 char:4
+ (gc <<<< texlive.profile) -replace './', './TinyTex/' | Out-File -encoding A
SCII texlive.profile
+ CategoryInfo : ObjectNotFound: (C:\Users\c77011...texlive.profi
le:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetCo
ntentCommand
C:\Users\dapeng\AppData\Local\Temp>rem download the custom package list
C:\Users\dapeng\AppData\Local\Temp>powershell -Command "Invoke-WebRequest https://github.com/yihui/tinytex/raw/master/tools/pkgs-custom.txt -OutFile pkgs-custom.txt"
The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet, functio
n, script file, or operable program. Check the spelling of the name, or if a pa
th was included, verify that the path is correct and try again.
At line:1 char:18
+ Invoke-WebRequest <<<< https://github.com/yihui/tinytex/raw/master/tools/pkg
s-custom.txt -OutFile pkgs-custom.txt
+ CategoryInfo : ObjectNotFound: (Invoke-WebRequest:String) [], C
ommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
C:\Users\dapeng\AppData\Local\Temp>rem an automated installation of TeXLive (infrastructure only)
C:\Users\dapeng\AppData\Local\Temp>cd install-tl-*
The filename, directory name, or volume label syntax is incorrect.
'install-tl-windows.bat' is not recognized as an internal or external command,
operable program or batch file.