浏览代码

Changed log folder path

I changed the log folder path from C:\Windows10Debloater to C:\Temp\Windows10Debloater
Richard Newton 6 年之前
父节点
当前提交
ad05dee3c0
共有 1 个文件被更改,包括 7 次插入6 次删除
  1. 7 6
      Windows10Debloater.ps1

+ 7 - 6
Windows10Debloater.ps1

@@ -4,17 +4,18 @@
 #no errors throughout
 $ErrorActionPreference = 'silentlycontinue'
 
-If (Test-Path "C:\Windows10Debloater") {
-    Write-Output "C:\Windows10Debloater exists. Skipping."
+$DebloatFolder = "C:\Temp\Windows10Debloater"
+If (Test-Path $DebloatFolder) {
+    Write-Output "$DebloatFolder exists. Skipping."
 }
 Else {
-    Write-Output "The folder 'C:\Windows10Debloater' doesn't exist. This folder will be used for storing logs created after the script runs. Creating now."
+    Write-Output "The folder "$DebloatFolder" doesn't exist. This folder will be used for storing logs created after the script runs. Creating now."
     Start-Sleep 1
-    New-Item -Path "C:\Windows10Debloater" -ItemType Directory
-    Write-Output "The folder C:\Windows10Debloater was successfully created."
+    New-Item -Path "$DebloatFolder" -ItemType Directory
+    Write-Output "The folder $DebloatFolder was successfully created."
 }
 
-Start-Transcript -OutputDirectory "C:\Windows10Debloater"
+Start-Transcript -OutputDirectory "$DebloatFolder"
 
 Add-Type -AssemblyName PresentationCore, PresentationFramework