3 Star 41 Fork 8

1柏洋/inav-configurator-chinese

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
post_install_cleanup.ps1 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
### this will remove the folders from %appdatalocal% for each user account on a given computer and then recreate the inav-configurator folder and place a text file in that folder. The script checks for this file and if it exsists will simply exit.
## because this checks each and every user on the windows machine ps will kick out some errors for any user that it doesnt have permission to access there local app data folder. these can be ignored.
#check for file
$txtfilepath = "C:\Users\$($_.Name)\AppData\Local\inav-configurator\check.txt"
$testpath = test-path $txtfilepath
if ($testpath -eq $true){
$append = "Terminated at time xxxxx"
$append | out-file $txtfilepath -append -force
break
}
else{
#continue script
# Get users
$users = Get-ChildItem -Path "C:\Users"
# Loop through users and delete the folder
$users | foreach-Object {
Remove-Item -Recurse -Path "C:\Users\$($_.Name)\AppData\Local\inav-configurator" -Force
}
}
#create new inav-configurator folder
New-Item -Path "C:\Users\$($_.Name)\AppData\Local\" -name "inav-configurator" -ItemType "directory"
# add text file to check for
New-Item -Path "C:\Users\$($_.Name)\AppData\Local\inav-configurator" -name "check.txt" -ItemType "file" -Value "config cleared"
break
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/YI_BOYANG/inav-configurator-chinese.git
git@gitee.com:YI_BOYANG/inav-configurator-chinese.git
YI_BOYANG
inav-configurator-chinese
inav-configurator-chinese
release-7.1.2

搜索帮助