Categorywindows 2012

Prevent write-output to perform linebreak

Sometimes you want to output some text and append an variable. Problem is that write-output usually performs a linebrak when appending.


$text = "some text."
Write-Output "this is " $text

Output will be:
this is
some text.

There are two ways you can solve this. One is to append the text to the variable before doing write-output. Second is to put the variable inside the quotation marks.


#Example 1
$text = "some text."
$textmessage = "This is " + $text
Write-Output $textmessage


#Example 2
$text = "some text."
Write-Output "this is $($text)"

Create a Windows Bootable usb pendrive (windows Vista, 7, 8, 8.1, 10, Server 2008, 2008R2, 2012 and 2012R2)

This procedure lets you install Windows from a usb pendrive. Works from Vista/2008 and later

First you need

* Usb pendrive of at least 4GB (Content will be erased)

* Windows installation medium or iso. Windows Vista or later

Prepare usb pendrive

* Insert the pendrive in an available port and copy any data you need to preserve to another locaiton

* Open an elevated commandprompt (“run as administrator”)

* Write “diskpart” and press enter

* Inside diskpart write “list disk” and identify the number for the pendrive.

* Enter the following command, in the example below the pendrive is disk 1 in diskpart.

SELECT DISK 1
CLEAN
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT FS=NTFS QUICK
ASSIGN
EXIT

* Copy the content of the Installation medium to the pendrive or extract the iso-file using 7-zip or similar program

Then you should be all set, remember the boot order in BIOS when you want to boot from the pendrive.

© 2020 IdefixWiki

Theme by Anders NorénUp ↑