Forum Discussion
AB21805
Apr 21, 2021Bronze Contributor
Creating a folder containing multiple files and sending to devices via intune
Hi all, I desperately need some help! And just thought Id post on here to see if someone can help! I need to create a folder on client machines in the c drive (Folder name: Spanish Games) which ...
- Apr 22, 2021Hi it would look like this
c:\intunepackage\
Inside this folder you need to create a folder "spanishgames"
Copy everything you have inside this folder
Create a powershell script (install.ps1) inside the c:\intunepackages\ folder
Inside the script,
-first create a new directory where the files need to be copied to (destination)
New-Item -Path "c:\" -Name "SpanishGames" -ItemType "directory" -force
-Then create a command to copy everything to the folder you you created
Copy-Item -Path "spanishgames\*" -Destination "C:\spanishgames" -Recurse -force
Now we have everything in place... open the intunewinapptool and specify the folder c:\intunepackages and the setup file: install.ps1
Upload it to intune and specify the c:\spanishgames folder as the detection rule
That should be it
Apr 22, 2021
Hi it would look like this
c:\intunepackage\
Inside this folder you need to create a folder "spanishgames"
Copy everything you have inside this folder
Create a powershell script (install.ps1) inside the c:\intunepackages\ folder
Inside the script,
-first create a new directory where the files need to be copied to (destination)
New-Item -Path "c:\" -Name "SpanishGames" -ItemType "directory" -force
-Then create a command to copy everything to the folder you you created
Copy-Item -Path "spanishgames\*" -Destination "C:\spanishgames" -Recurse -force
Now we have everything in place... open the intunewinapptool and specify the folder c:\intunepackages and the setup file: install.ps1
Upload it to intune and specify the c:\spanishgames folder as the detection rule
That should be it
c:\intunepackage\
Inside this folder you need to create a folder "spanishgames"
Copy everything you have inside this folder
Create a powershell script (install.ps1) inside the c:\intunepackages\ folder
Inside the script,
-first create a new directory where the files need to be copied to (destination)
New-Item -Path "c:\" -Name "SpanishGames" -ItemType "directory" -force
-Then create a command to copy everything to the folder you you created
Copy-Item -Path "spanishgames\*" -Destination "C:\spanishgames" -Recurse -force
Now we have everything in place... open the intunewinapptool and specify the folder c:\intunepackages and the setup file: install.ps1
Upload it to intune and specify the c:\spanishgames folder as the detection rule
That should be it
- Bapo16Oct 18, 2021Copper Contributor
Rudy_Ooms_MVP I tried to follow these steps and i just get a 0x80070001 error in Intune. from my trouble shooting it cant seem to find the files when trying to do the copy. Any ideas if i have missed something?
New-Item -Path "c:\" -Name "AskIT" -ItemType "directory" -force
Copy-Item -Path "askit\*" -Destination "C:\AskIT" -Recurse -forceThanks for any help.- Oct 18, 2021Hi,
Did you try to run the copy-item -path askit on the device itself? What happens?
Looking at the screenshot, could you change the install command to this. (change the scriptname to your scrptname)
powershell.exe -ExecutionPolicy Bypass -File .\Scriptname.ps1- Bapo16Oct 18, 2021Copper ContributorIf i edit the ps1 script with the full path locally then it works no issues but not sure what the path should be if the files are coming from Intune?
- motion2082Oct 01, 2021Copper ContributorHi Rudy,
If I have a ZIP file called Epic.zip (1.4GB) that I want to copy to C:\Temp then Extract on the target machine at C:\Epic would I be able to use this process above?- DavidWiklundAug 05, 2022Copper ContributorYou can use command
New-Item -Path "c:\filename" -ItemType "directory" # this will create a directory in your C:\
powershell.exe -command Expand-Archive -Force 'filename.zip' -DestinationPath c:\filename
Remove-Item -Recurse c:\filename # if you want to trhe file be removed after extracting
If you dont want to create folder thern use command copy-item - Oct 01, 2021Hi, Yes you could but you need to add a powershell command to extract the zip file...