PSD icon indicating copy to clipboard operation
PSD copied to clipboard

ZTI Gather Variables for use in CustomSettings.ini

Open SBolt11 opened this issue 2 years ago • 5 comments

Good Morning,

First of all, thanks very much for sharing PSD with us all. I would just like to know if there are plans to include the classic variables we used to be able to use in customsettings.ini to set our own custom variables or if this has already been done and I'm missing something as a new user?

E.g. If I want to process a new section called [Virtual Machine] so I can set the custom variable of MachineType to V, but when I do the [Virtual Machine] section is not processed. I have no problem setting the custom variables in the [Default] section or another custom section which is always processed (for testing purposes). I have so far used Make and Model as Priority values.

Thanks in advance

Cut down CustomSettings.ini

[Settings] Priority=Init,Make,Model,Default Properties=MachineType,LogUserDomain,LogUserID,LogUserPassword,DriverPath,GenericDriverPath,FallBackDriverPath,PSDWizard,PSDWizardTheme

[Init] ;MachineType=V

[Virtual Machine] MachineType=V

[Default] OSInstall=Y PSDWizard=PSDWizardNew PSDWizardTheme=Classic

OSDComputername=C-%MachineType%-%SERIAL:7%

SBolt11 avatar Jun 14 '23 10:06 SBolt11

Hi Sbolt11,

Any custom added section, should be also in the Priority property, in order to be processed. Can you try that and reply please?

With regards,

GeoSimos avatar Jun 24 '23 14:06 GeoSimos

By the way, the OSDComputerName in that convention will not work because this is the one recognized by VBS/WSF. You will need a user exit PowerShell script to do custom dynamic device namings.

GeoSimos avatar Jun 24 '23 21:06 GeoSimos

@SBolt11 i am curious how you came upon the %SERIAL:7%? I assume you took some time to read the PSDwizard code; kudos to you! This is a "hidden" feature in the PSDWizard that I wrote a while back. I haven't fully tested it using priority variables but have done testing with defaults. Let me know if works.

However upon some requests, I have a pull request in for that to be documented. This feature is documented there: https://github.com/FriendsOfMDT/PSD/pull/88

PowerShellCrack avatar Jun 25 '23 13:06 PowerShellCrack

@SBolt11 i am curious how you came upon the %SERIAL:7%? I assume you took some time to read the PSDwizard code; kudos to you! This is a "hidden" feature in the PSDWizard that I wrote a while back. I haven't fully tested it using priority variables but have done testing with defaults. Let me know if works.

However upon some requests, I have a pull request in for that to be documented. This feature is documented there: #88

To be honest, I haven't noticed that @PowerShellCrack ;-) Time to test it a bit! Thanks for the heads up!

GeoSimos avatar Jun 25 '23 17:06 GeoSimos

Good Morning Both of you, thanks for your replies.

@PowerShellCrack I must admit to only reading another closed post on FriendsofMDT suggesting the %SERIAL:7% code, although I have read through a lot of the code, my PowerShell skills have some catching up to do!

@GeoSimos, the Make, Model are in the Priority section which should have [Virtual Machine] covered, at least that's how I used to do it. The rules see my Hyper-V test as [Virtual Machine] and should then process that section, maybe I missed something else...? Also, I am not familiar yet with user exit scripts, I've only been using MDT PSD for a few weeks would like to learn more about this feature if someone can point me in a direction perhaps? My previous experience was with MDT around 10 years ago.

Thanks

SBolt11 avatar Jun 26 '23 06:06 SBolt11