import base64


def get_stage1_command(stage1_file):
	"""
	The format of a PowerShell encoded command is a base64 encoded UTF-16LE string.
	This function reads the stage 1 file (UTF-8) into a string, converts it into UTF-16LE encoding, and then base64 encodes that.
	In Python, Base64 conversion requires Bytes objects, so we decode the resulting Base64 encoded Bytes object into a UTF-8 string.
	"""
	with open(stage1_file, 'r') as in_file:
		data = in_file.read()

	data = data.encode('utf-16-le')
	data = base64.b64encode(data)
	data = data.decode('utf-8')
	return data