Forum Discussion
Waqaarahsab
Oct 21, 2020Copper Contributor
How to make a file in localappdata location using powershell
I am trying to create a file in the localappdata location in powershell. i have tried using $env:localappdata but it just shows the localappdata location just like write-host C:\Users\%username%\AppD...
- Oct 21, 2020
if you want to change the current directory to go to AppData, try set-location $env:LOCALAPPDATA
if you want to write content to the folder
did you try something like this
New-Item -Path "$($env:LOCALAPPDATA)\NewContent.txt"
farismalaeb
Oct 21, 2020Steel Contributor
if you want to change the current directory to go to AppData, try set-location $env:LOCALAPPDATA
if you want to write content to the folder
did you try something like this
New-Item -Path "$($env:LOCALAPPDATA)\NewContent.txt"
Waqaarahsab
Oct 22, 2020Copper Contributor
farismalaeb Thank you, I never knew it was that simple 😅