![]() $null = New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer " -Name "Main " -Force $null = New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft " -Name "Internet Explorer " -Force Write-Log -Message "Disabling IE first run wizard " -Component "Preparation " # This prevents an error running Invoke-WebRequest when IE has not yet been run in the current context Write-Log -Message "# Starting BIOS update run # " -Component "Preparation " Write-Log -Message "# " -Component "Preparation " Invoke-WebRequest -Uri $URI2 -Method PUT -Headers $Headers2 -Body $Body2 -ErrorAction Silentl圜ontinue $URI2 = " $ContainerURL/ $FolderPath/ $ ( $ Env:COMPUTERNAME )`_ $Date`_ $ ( $File2. FullName) -Raw -ErrorAction Silentl圜ontinue $File2 = Get-Item $WorkingDirectory\HP_BIOS_Update.log -ErrorAction Silentl圜ontinue Invoke-WebRequest -Uri $URI -Method PUT -Headers $Headers -Body $Body -ErrorAction Silentl圜ontinue $URI = " $ContainerURL/ $FolderPath/ $ ( $ Env:COMPUTERNAME )`_ $Date`_ $ ( $File. $HPBIOSUPDRECLog = Get-ChildItem -Path $WorkingDirectory -Include HPBIOSUPDREC64.log -Recurse -ErrorAction Silentl圜ontinue $HpFirmwareUpdRecLog = Get-ChildItem -Path $WorkingDirectory -Include HpFirmwareUpdRec.log -Recurse -ErrorAction Silentl圜ontinue $Date = Get-date -Format "yyyy-MM-dd_HH.mm.ss " # Function to upload log file to Azure Blob storage $LineFormat = $Message, $TimeGenerated, ( Get-Date -Format MM -dd -yyyy), $Component, $LogLevelĪdd-Content -Value $Line -Path $LogFile -ErrorAction Silentl圜ontinue $TimeGenerated = " $ ( Get-Date -Format HH:mm:ss ). $Message = " $Message " " $Exception " $LogFile = " $WorkingDirectory\HP_BIOS_Update.log " # Function write to a log file in ccmtrace format $ script:WorkingDirectory = " $RootFolder\ $ParentFolderName\ $ChildFolderName\ $ChildFolderName2 " $ChildFolderName2 = Get-Date -Format "yyyy-MMM-dd_HH.mm.ss " $ProgressPreference = 'Silentl圜ontinue ' # to speed up web requests $ script:SASToken = "mysastoken " # the SAS token string for the container (with write permission) $ script:FolderPath = "HP_BIOS_Updates " # the subfolder to put logs into in the storage container $ script:ContainerURL = " " # URL of your Azure blob storage container $HPIAWebUrl = " " # Static web page of the HP Image Assistant ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |