Sub CreateAfile Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile("c:\testfile.txt", True) a.WriteLine("This is a test.") a.Close End Sub
При попытке запустить вышеупомянутый код в Powershell я получаю "Missing expression after ','".Спасибо
Это не совсем PowerShell, это VB Script.
PowerShell
VB Script
Создать файл в PowerShell так же просто, как:
New-Item -Name "myFile.txt" -ItemType File -Path "C:\temp"