Noob needs some Help with XLM License file

Hey Fellas,

I am new to the world of PowerShell scripting, the PSA toolkit has been awesome in helping me build Intune software packages and I am slowly getting the hang of this. But I am stuck on one package. I have an software that uses an XLM license file and I am trying to figure out how I can copy this file to the local users system.

I can get the software to install correctly, But I don’t know what code to use to copy this license file. I have placed the license file in SupportFiles folder. It’s called License.xml. It needs to be copied to “%appdata%\Roaming\NewCode” folder.

I tried using the follwing code in the “post installtion Task” area but it doesn’t seem to work

Copy-item “$dirSupportFiles\License.xml” -destination “%AppData%\Roaming\NewCode” -recurse

I did notice that the “NewCode” folder does not get created in Appdata until the application is launched for the first time. How can I get the folder created during install and have the license file placed in there so when the app launches it automatically detects the license.

%AppData% contains the “Roaming” directory so your destination path should look like this:

Copy-item “$dirSupportFiles\License.xml” -destination “%AppData%\NewCode” -recurse

%AppData% doesn’t work in Powershell.

Copy-item "$dirSupportFiles\License.xml" -destination "$EnvAppData\NewCode" -recurse
1 Like

I totally knew that :wink: Should be $env:APPDATA though. Don’t forget the colon.

Hey fellas I appreciate the help, but it still doesn’t seem to be working. This is what I have in my Post installation section:

Copy-item “$dirSupportFiles\License.xml” -destination “$Env:AppData\NewCode” -recurse

I have the License.xml file inside the “SupportFiles” folder. if I look at the installation log there is no mention of a license.xml file or any NewCode folder. And the folder is not being created in the Appdata/Roaming location

So I am not sure what I am doing wrong.

Nevermind gents … I got it to work. :slightly_smiling_face: thanks for the earlier assist.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.