Jump to content
Braingears

Automate Install - Rip & Replace - Powershell

Recommended Posts

I have merged the recent branch that is more aggressive with removing the registry keys if the Automate Uninstaller does not do it properly. Let me know if this works better for you. 

In the future, add -Verbose to your string to more more details. It will show if anything is left behind. 

%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -Command "Invoke-Expression(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/Braingears/PowerShell/master/Automate-Module.psm1'); Install-Automate -Server 'YOURSERVER.DOMAIN.COM' -LocationID 2 -Transcript -Verbose"
 

 

Share this post


Link to post
Share on other sites

Thank you @Braingears

 

I've tested the new version but is not working for one of the machines.

 

First try (without -Verbose):

Transcript started, output file is C:\Windows\Temp\Automate_Deploy.txt
Removing Existing Automate Agent...
The Automate Agent Uninstalled Successfully
Automate is NOT Installed
Installing Automate Agent to https://MY_SERVER_ADDRESS
The Automate Agent FAILED to Install


ComputerName  : COMPUTER-NAME
ServerAddress : Enter the server address here.
ComputerID    : 
ClientID      : 
LocationID    : 15
Version       : 
InstFolder    : True
InstRegistry  : True
Installed     : True
Service       : Running
Online        : 

Transcript stopped, output file is C:\Windows\Temp\Automate_Deploy.txt

 

Second try, with -Verbose:

 

Transcript started, output file is C:\Windows\Temp\Automate_Deploy.txt
VERBOSE: Checking Operating System (WinXP and Older) for HTTP vs HTTPS
VERBOSE: Checking if Automate Server URL is active. Server entered: MY_SERVER_ADDRESS
VERBOSE: https://MY_SERVER_ADDRESS is Active
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: If ServerAddress matches, the Automate Agent is currently Online, and Not forced to Rip & Replace then 
Automate is already installed.
VERBOSE: False
VERBOSE: Removing Existing Automate Agent
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
Removing Existing Automate Agent...
VERBOSE: Closing Open Applications and Stopping Services
VERBOSE: The Automate Agent Uninstaller Executed Without Errors
VERBOSE: Checking For Removal - Loop 5X
VERBOSE: @{ComputerName=COMPUTER-NAME; InstFolder=False; InstRegistry=False; Installed=False; Service=; Online=False}
VERBOSE: Automate Uninstaller Completed Successfully
The Automate Agent Uninstalled Successfully
VERBOSE: The Automate Agent Uninstalled Successfully
VERBOSE: @{ComputerName=COMPUTER-NAME; InstFolder=False; InstRegistry=False; Installed=False; Service=; Online=False}
Automate is NOT Installed
VERBOSE: Installing Automate Agent on https://MY_SERVER_ADDRESS
Installing Automate Agent to https://MY_SERVER_ADDRESS
VERBOSE: MSIEXEC Log Files: C:\Windows\Temp\Automate_Agent_2020-05-15_12-47-52.log
VERBOSE: The Automate Agent Installer Executed Without Errors
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
VERBOSE: @{ComputerName=COMPUTER-NAME; ServerAddress=Enter the server address here.; ComputerID=; ClientID=; 
LocationID=15; Version=; InstFolder=True; InstRegistry=True; Installed=True; Service=Running; Online=}
The Automate Agent FAILED to Install


ComputerName  : COMPUTER-NAME
ServerAddress : Enter the server address here.
ComputerID    : 
ClientID      : 
LocationID    : 15
Version       : 
InstFolder    : True
InstRegistry  : True
Installed     : True
Service       : Running
Online        : 

Transcript stopped, output file is C:\Windows\Temp\Automate_Deploy.txt

 

Any idea on what can be the issue?

 

Thanks

Share this post


Link to post
Share on other sites

This has been an issue that I've been seeing for years now, and one of the reasons I created the script's check to compare the existing Server registry settings against the targeted server address. The next time this script executes, it will see that the address doesn't match and will Rip & Replace the agent. I haven't found any common denominator on why the server's address doesn't get written to the registry whereas the LoacationID and Password gets properly written from the MSI. I've escalated this all the way up-the-chain, but haven't gotten any traction on getting this issue resolved. Not enough people have complained about it...
This is the reason why I started creating the MSI log files by default. MSIEXEC Log Files:
C:\Windows\Temp\Automate_Agent_2020-05-15_12-47-52.log


My recommendation is to create a ticket with support and include the MSI log file referenced above. In the log file, it specifically show the server's address and that it doesn't get written to the registry whereas the LocationID and Password does get written. 

The user account showing what permissions were used are listed at the top of the Transcript located at:
C:\Windows\Temp\Automate_Deploy.txt

The actual install string is: 
msiexec.exe /i C:\Support\Automate\Automate_Agent.msi /quiet /norestart LOCATION=2 /L*V C:\Windows\Temp\Automate_Agent_DATE.log

Share this post


Link to post
Share on other sites

To your previous comments, the uninstaller appears to be working as intended. It didn't have to take additional steps to delete the existing registry keys.

VERBOSE: @{ComputerName=COMPUTER-NAME; InstFolder=False; InstRegistry=False; Installed=False; Service=; Online=False}
VERBOSE: Automate Uninstaller Completed Successfully

InstFolder=False -  The C:\Windows\LTSVC\ has been removed.
InstRegistry=False - The HKLM\SOFTWARE\LabTech\Service\ registry keys have been removed. 
Service=<Blank> - The service is not only stopped, but also removed. 

 

Share this post


Link to post
Share on other sites
On 5/16/2020 at 8:03 AM, Braingears said:

This has been an issue that I've been seeing for years now, and one of the reasons I created the script's check to compare the existing Server registry settings against the targeted server address. The next time this script executes, it will see that the address doesn't match and will Rip & Replace the agent. I haven't found any common denominator on why the server's address doesn't get written to the registry whereas the LoacationID and Password gets properly written from the MSI.

We've had this same issue in many different ways.

I just finished my own script to fix broken agents before I found this threat ...

I did it quite simple: 

1. check path of the agent

2. if not existant, install msi

3. read the registry entry for the server adress

4. if not matching the desired, stop services, fix entry

5. start services (because we also had some clients just not starting their services correctly)

 

Maybe you wanna implement my step 3 and 4 at the end instead of doing a complete Rip and Replace on the next execution @Braingears?

 

$AutomateSrvAddrReg = (Get-ItemProperty "HKLM:\SOFTWARE\LabTech\Service").'Server Address'

If ($AutomateURL -ne $AutomateSrvAddrReg)
{
    Get-Service lts* | Where {$_.status –eq 'Running'} |  Stop-Service
    Set-ItemProperty -Path HKLM:\SOFTWARE\LabTech\Service 'Server Address' -Value $AutomateURL –Force
}

Share this post


Link to post
Share on other sites

I've thought about changing the registry key, and so far have decided against it. A lot of people use the script to replace already existing Automate installations (from pre-existing MSPs) with their own. If the server address is changed, the Password (also located in the registry) will fail to authenticate with the Automate Server.

I am already checking the server location to confirm the installation was success or failure. I could possibly check for "Enter the server address here." and change it. I would really prefer if they would fix the issue rather than these constant work-arounds. I will consider it.

Share this post


Link to post
Share on other sites

@VistaMeansDeath I've created a Branch with the requested changes. Although I've tested it on spectrum of computers, I wasn't getting the Server Address error in order for the fix to kick in (at least that I could see from the verbose logs). Please feel free to test this current test branch, and let me know if it helps.
https://raw.githubusercontent.com/Braingears/PowerShell/TestUpdates/Automate-Module.psm1

%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -Command "Invoke-Expression(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/Braingears/PowerShell/TestUpdates/Automate-Module.psm1'); Install-Automate -Server 'YOURSERVER.DOMAIN.COM' -LocationID 2 -Transcript -Verbose"

 

Share this post


Link to post
Share on other sites
2 minutes ago, Braingears said:

@VistaMeansDeath I've created a Branch with the requested changes. Although I've tested it on spectrum of computers, I wasn't getting the Server Address error in order for the fix to kick in (at least that I could see from the verbose logs). Please feel free to test this current test branch, and let me know if it helps.
https://raw.githubusercontent.com/Braingears/PowerShell/TestUpdates/Automate-Module.psm1


%windir%\system32\WindowsPowerShell\v1.0\powershell.exe -Command "Invoke-Expression(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/Braingears/PowerShell/TestUpdates/Automate-Module.psm1'); Install-Automate -Server 'YOURSERVER.DOMAIN.COM' -LocationID 2 -Transcript -Verbose"

 

Thanks I'll try that!

The more I test the more errors surface at the moment ...
We had Clients reuse an already taken ID yesterday, today we have new Clients not reporting to the automate server or showing up in the collector location even tho the location they should use is set ... Im almost full time fixing automate hickups for ~ 3 weeks now and I feel like Im turning mad slowly. 😅

Share this post


Link to post
Share on other sites

@VistaMeansDeath Clients reuse an already taken ID? Do you mean multiple computers are getting the same ComputerID?

Check these computers to see if they are running a VPN. Compare if any of these computers have a NIC with the same MAC address (especially if they're connected to the VPN while the agent is installed). 

In the script module, if the LocationID is excluded, it will default to LocationID 1

Share this post


Link to post
Share on other sites
23 minutes ago, Braingears said:

@VistaMeansDeath Clients reuse an already taken ID? Do you mean multiple computers are getting the same ComputerID?

Yes, exactly.

23 minutes ago, Braingears said:

Check these computers to see if they are running a VPN. Compare if any of these computers have a NIC with the same MAC address (especially if they're connected to the VPN while the agent is installed). 

most of the computers we had this issue had neither a vpn connection nor the same MAC address but it seems like another reinstall fixed this issue. 
The problem here is that direct access to the machines is basically impossible. I can schedule scripts as Startup scripts to execute commands via GPO, thats mostly it.

 

Your module produced following error for me:

VERBOSE: @{ComputerName=HD-MTECH4; ServerAddress=https://10.10.x.x; ComputerID=; ClientID=; LocationID=2; Version=; InstFolder=True; InstRegistry=True; Installed=True;
Service=Running; Online=}

As install result. This is an error related to our connectwise instance. All downloaded installer packages include the internal IP of our server instead of the FQDN ...
This was fixable by adding the server address again to both calls of  the msiexec for agent install:

Start-Process "msiexec.exe" -ArgumentList "/i $($SoftwareFullPath) /quiet /norestart LOCATION=$($LocationID) SERVERADDRESS=$($AutomateURL)

Which would be great if you added that to the official powershell module.

 

After installing again with this fix the agent installed correctly, the script still reported a fail:

VERBOSE: @{ComputerName=HD-MTECH4; ServerAddress=https://"correctdomain".de; ComputerID=1555; ClientID=1; LocationID=2; Version=200.172; InstFolder=True; InstRegistry=True; Installed=True;
Service=Running; Online=}
The Automate Agent FAILED to Install

 

Share this post


Link to post
Share on other sites
23 minutes ago, VistaMeansDeath said:

After installing again with this fix the agent installed correctly, the script still reported a fail:


VERBOSE: @{ComputerName=HD-MTECH4; ServerAddress=https://"correctdomain".de; ComputerID=1555; ClientID=1; LocationID=2; Version=200.172; InstFolder=True; InstRegistry=True; Installed=True;
Service=Running; Online=}
The Automate Agent FAILED to Install

 

Found the Error.
The Online check doesn't work, at least for me.
It says the registry key can't be converted to System.DateTime.

Share this post


Link to post
Share on other sites

First of all, you need to use the proper FQDN to your Automate Server. In the event that the script is run a second time, it will notice that the server you are pointing to and what may already be installed are different and perform a Rip & Replace automatically in order to migrate the computer to the proper Automate Server. 

Quote

VERBOSE: @{ComputerName=HD-MTECH4; ServerAddress=https://"correctdomain".de; ComputerID=1555; ClientID=1; LocationID=2; Version=200.172; InstFolder=True; InstRegistry=True; Installed=True;
Service=Running; Online=}
The Automate Agent FAILED to Install

In this instance, I think the Installation simply timed out, and when the script exited it had not yet checked in successfully. I would check the LTERROR.txt for further information.
It looks like it successfully communcated with the Automate server to get the ComputerID, but has not checked in or gotten a heartbeat. 

Please try and see if you are getting the heartbeat or check-in yet. 

Confirm-Automate -Show

 

Share this post


Link to post
Share on other sites
9 minutes ago, Braingears said:

Please try and see if you are getting the heartbeat or check-in yet. 


Confirm-Automate -Show

I did. The problem is, that the Online Check fails.
The conversion of the date from the registry key for the last contact to System.DateTime fails. 

image.png.a81b2d3822dda9dff21b17122dcd81d0.png

 

Online Check is done by the following line of your module:

$Online = If ((Test-Path "HKLM:\SOFTWARE\LabTech\Service") -and ((Get-Service ltservice).status) -eq "Running") {((( (Get-Date) - [System.DateTime](Get-ItemProperty "HKLM:\SOFTWARE\LabTech\Service").LastSuccessStatus).TotalSeconds) -lt 600)} Else {Write $False}

and this fails:

image.png.d29e17b71be30babbac3161b4a60e3f9.png

image.png.a74c89f340bd0cd139db79d294d5b5b9.png

Share this post


Link to post
Share on other sites

I have to confess that I am not familiar with how the Powershell commands are different when running in German language (de-DE). I also don't have any environments available for me to test with.

It appears that Automate may be storing the Status in a different time/date format than your German OS.

LastSuccessStatus      : 5/28/2020 7:03:08 PM

Does anyone have any ideas on how I can make this PowerShell string work for all languages?

Share this post


Link to post
Share on other sites
5 minutes ago, Braingears said:

I have to confess that I am not familiar with how the Powershell commands are different when running in German language (de-DE). I also don't have any environments available for me to test with.

It appears that Automate may be storing the Status in a different time/date format than your German OS.


LastSuccessStatus      : 5/28/2020 7:03:08 PM

Does anyone have any ideas on how I can make this PowerShell string work for all languages?

Hello Braingears

 

Please take a look at this: https://devblogs.microsoft.com/scripting/use-culture-information-in-powershell-to-format-dates/

 

Let me know if that helps.

 

Thank you

Share this post


Link to post
Share on other sites

So I have a several options here.

  1. Check Get-Culture and check for "en-US". If the language is different, skip all confirmations to see if the Automate Agent is online.
  2. Compare how the timestamp is saved into the registry by Automate and attempt to convert it for the same functionality.
  3. Create a -Quick parameter that just executes the .MSI, without checking if the Automate Agent has checked in. This would also exclude the confirmation output showing the Server, ComputerID, etc..

Let me know your feedback (or additional options).

 

As it stands now, the Install-Automate Command will install the agent successfully in German. Although if it's run a second time, it will think that the Automate Agent is not online nor checking-in and will attempt to R&R the agent in order to fix the problem.

Share this post


Link to post
Share on other sites
7 hours ago, Braingears said:

It appears that Automate may be storing the Status in a different time/date format than your German OS.


LastSuccessStatus      : 5/28/2020 7:03:08 PM

Does anyone have any ideas on how I can make this PowerShell string work for all languages?

Yeah that seems to be the problem.

image.png.6802af7ec6a8ad30dbd957c66a0d66a7.png

 

But this should fit the german time format System.DateTime tries to compare to so I dont understand why it cant convert ...

image.png.ccf8a21ea88dd3c44bb5a6748cd20a13.png

7 hours ago, Braingears said:

@VistaMeansDeathWhat do you get when you run:


Confirm-Automate -Raw

Heres the output:

image.thumb.png.d82b10770e1527391d93986e9ddfa5f5.png

7 hours ago, Braingears said:

So I have a several options here.

  1. Check Get-Culture and check for "en-US". If the language is different, skip all confirmations to see if the Automate Agent is online.
  2. Compare how the timestamp is saved into the registry by Automate and attempt to convert it for the same functionality.
  3. Create a -Quick parameter that just executes the .MSI, without checking if the Automate Agent has checked in. This would also exclude the confirmation output showing the Server, ComputerID, etc..

 

At the moment I've cloned your module in our cloud storage and just set $Online = $ True to ignore the check completely and I had to change the msiexec to hand the server address to the installation manually like stated above:

On 5/27/2020 at 3:03 PM, VistaMeansDeath said:

This was fixable by adding the server address again to both calls of  the msiexec for agent install:


Start-Process "msiexec.exe" -ArgumentList "/i $($SoftwareFullPath) /quiet /norestart LOCATION=$($LocationID) SERVERADDRESS=$($AutomateURL)

 

 

I found a solution for the Date Problem!

8 hours ago, mcretari said:

Conversion with this post worked fine.

Converted like this the Date has the same format as the registry entry and should be comparable:

image.png.8dc93746ee6da64cb259f1d6f6111141.png

$cultures = “de-DE”

foreach ($c in $cultures)

{

 $culture = New-Object system.globalization.cultureinfo($c)

 $date = get-date -format ($culture.DateTimeFormat.DatePattern)

 New-Object psobject -Property @{“name”=$culture.displayname; “date”=$date}

}

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...