Skip to content

Instantly share code, notes, and snippets.

2021/09/21 07:39:34 [INFO] (telemetry) Starting provisioner powershell
==> oracle-oci: Provisioning with Powershell...
2021/09/21 07:39:34 packer-provisioner-powershell plugin: Found command: & C:\Windows\Panther\Generalize.cmd
2021/09/21 07:39:34 packer-provisioner-powershell plugin: Found command: while($true) { $imageState = Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State | Select ImageState; if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output $imageState.ImageState; Start-Sleep -s 10 } else { break } }
==> oracle-oci: Provisioning with powershell script: /tmp/powershell-provisioner557910254
2021/09/21 07:39:34 packer-provisioner-powershell plugin: Opening /tmp/powershell-provisioner557910254 for reading
2021/09/21 07:39:34 packer-provisioner-powershell plugin: Uploading env vars to c:/Windows/Temp/packer-ps-env-vars-61498a73-f1d0-2cad-3480-cb143477bb4c.ps1
2021/09/21 07:39:34 packer-provisioner-powershell plugin: [INFO] 76 bytes written for '
@codingarchitect
codingarchitect / template.json
Created September 21, 2021 07:28
packer template for windows server 2019 oci packer builder
{
"variables": {
"user_ocid":"{{env `user_ocid`}}",
"tenancy_ocid": "{{env `tenancy_ocid`}}",
"fingerprint":"{{env `fingerprint`}}",
"private_key_path":"{{env `private_key_path`}}",
"private_key_password":"{{env `TF_VAR_private_key_password`}}",
"availability_domain": "uwhB:EU-FRANKFURT-1-AD-1",
"region": "eu-frankfurt-1",
"base_image_ocid": "ocid1.image.oc1.eu-frankfurt-1.redacted",
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\System.ServiceModel.dll</Reference>
<Namespace>System.ServiceModel</Namespace>
</Query>
void Main()
{
CallService();
}
@codingarchitect
codingarchitect / WindsorWcfService.linq
Created January 24, 2017 10:55
WindsorWcfService.linq
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\Microsoft.CSharp.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Runtime.InteropServices.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Runtime.InteropServices.WindowsRuntime.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Runtime.Serialization.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.ServiceModel.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Web.dll</Reference>
<NuGetReference>Castle.WcfIntegrationFacility</NuGetReference>
<NuGetReference>CodingArchitect.Utilities</NuGetReference>
<NuGetReference>Microsoft.Web.Administration</NuGetReference>
@codingarchitect
codingarchitect / WebService.linq
Created January 18, 2017 08:54
Create a web service (App Pool, Web Site, Web Application in IIS), Compiles the code to a separate assembly, Gives permissions to the app pool identity to the web service folder.
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\Microsoft.CSharp.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Runtime.InteropServices.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Runtime.InteropServices.WindowsRuntime.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Runtime.Serialization.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.ServiceModel.dll</Reference>
<NuGetReference>Microsoft.Web.Administration</NuGetReference>
<NuGetReference>NUnitLite</NuGetReference>
<NuGetReference>CodingArchitect.Utilities</NuGetReference>
<Namespace>Microsoft.CSharp</Namespace>
@codingarchitect
codingarchitect / AppDomain.linq
Created January 18, 2017 08:38
LINQPad Query that compiles code to a different executable and executes it in a different app domain with shadow copying - The executable folder can be used to execute the exe standalone as well.
<Query Kind="Program">
<Reference>&lt;RuntimeDirectory&gt;\Microsoft.CSharp.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Runtime.InteropServices.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Runtime.InteropServices.WindowsRuntime.dll</Reference>
<NuGetReference>CodingArchitect.Utilities</NuGetReference>
<NuGetReference>Microsoft.Web.Administration</NuGetReference>
<NuGetReference>NHibernate</NuGetReference>
<NuGetReference>NUnitLite</NuGetReference>
<NuGetReference>SqlLocalDb</NuGetReference>
<Namespace>CodingArchitect.Utilities.AppDomain</Namespace>