<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin: 0; padding: 0; background-color: transparent; }
.code-container { border: 1px solid #444; border-radius: 6px; background-color: #1e1e1e; overflow: hidden; position: relative; }
.code-header { background-color: #2d2d2d; padding: 8px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #444; }
.code-title { color: #aaa; font-size: 12px; font-weight: bold; font-family: monospace; }
.copy-btn { background-color: #0078d4; color: white; border: none; padding: 6px 12px; border-radius: 4px; font-size: 12px; cursor: pointer; font-weight: bold; transition: background 0.2s; }
.copy-btn:hover { background-color: #005a9e; }
.copy-btn.copied { background-color: #107c41; }
pre { margin: 0; padding: 16px; overflow-y: auto; max-height: 450px; }
code {
font-family: "Consolas", "Courier New", Courier, monospace;
color: #d4d4d4;
font-size: 13px;
line-height: 1.5;
white-space: pre-wrap;
word-break: break-word;
}
.placeholder-header { color: #757575; font-style: italic; display: block; margin-bottom: 8px; }
</style>
</head>
<body>
<div class="code-container">
<div class="code-header">
<span class="code-title">POWERSHELL SCRIPT</span>
<button class="copy-btn" onclick="copyCode(this)">Copy Code</button>
</div>
<pre><code><span class="placeholder-header"># --- COPIED DIRECTLY TO CLIPBOARD BELOW THIS LINE ---</span><span id="powershellCode">Paste TEXT to be copied here</span></code></pre>
</div>
<script>
function copyCode(button) {
// Grab ONLY the text inside the targeted PowerShell ID
var codeText = document.getElementById("powershellCode").innerText;
// Create a temporary textarea element off-screen
var tempTextArea = document.createElement("textarea");
tempTextArea.value = codeText;
tempTextArea.style.position = "absolute";
tempTextArea.style.left = "-9999px";
document.body.appendChild(tempTextArea);
// Force select the exact contents inside the hidden field
tempTextArea.select();
tempTextArea.setSelectionRange(0, 99999); // For mobile devices
try {
// Execute the direct copy command within the sandboxed frame
var successful = document.execCommand('copy');
if (successful) {
button.innerText = "Copied!";
button.classList.add("copied");
setTimeout(function() {
button.innerText = "Copy Code";
button.classList.remove("copied");
}, 2000);
} else {
button.innerText = "Error copying";
}
} catch (err) {
console.error('Fallback copy method failed: ', err);
}
// Instantly destroy the temporary hidden element
document.body.removeChild(tempTextArea);
}
</script>
</body>
</html>